" Urban v. Brailey, 85 Neb. 796, 798-99, 124 N.W. 467. "It has been held that the proper method of attacking the petition is by motion to quash the writ, and that insufficiency in the petition is waived unless that remedy be resorted to. ( McGlennan v. Margowski, 90 Ind. 150.)" Nebraska Children's Home Society v. State, 57 Neb. 765, 769, 78 N.W. 267. See also Chase v. State, 93 Fla. 963, 113 So. 103; State ex rel. Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111; Stuart v. State, 36 Ariz. 28, 282 P. 276; State ex rel. Davis v. Hardie, 108 Fla. 133, 146 So. 97; Ex parte Tipton, 83 Cal.App. 742, 257 P. 445; Deaver v. State, 24 Ala. App. 377, 135 So. 604; McDowell v. Gould, 166 Ga. 670, 144 S.E. 206; Ex parte Tollison, 73 Okla. Cr. 38, 117 P.2d 549; People v. Superior Court, 234 Ill. 186, 84 N.E. 875; Willis v. Bayles, 105 Ind. 363, 5 N.E. 8.See also Cochran v. Kansas, 316 U.S. 255; Bowen v. Johnston, 306 U.S. 19.
See Tyler v. Warden, Nebraska State Prison, No. A–02–295, 2003 WL 21398153 (Neb.App. June 17, 2003) (not designated for permanent publication). Moreover, most states with statutory requirements similar to § 29–2801 do not treat compliance with such requirements as jurisdictional. See, Nguyen v. State, 282 Ga. 483, 651 S.E.2d 681 (2007), overruled on other grounds, Brown v. Crawford, 289 Ga. 722, 715 S.E.2d 132 (2011); State ex rel. v. Adult Parole, 80 Ohio St.3d 639, 687 N.E.2d 761 (1998); People ex rel. Negron v. Herold, 33 A.D.2d 1076, 307 N.Y.S.2d 710 (1970); State ex rel. Hansen v. Utecht, 230 Minn. 579, 40 N.W.2d 441 (1950); State ex rel. Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111 (1930); In the Matter of Beard, 4 Ark. 9 (1842); In re Spates, No. 14–14–00524–CV, 2014 WL 3051311 (Tex.App. July 3, 2014) (unpublished). But see Evans v. Dist. Ct., 194 Colo. 299, 572 P.2d 811 (1977).
The respondent to whom a writ of habeas corpus is addressed can attack the petition if he desires by a motion to quash the writ. State ex rel. Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111, 114 (1930). But on a motion to quash the writ, the allegations of the petition are deemed admitted.
When the writ is issued the petition has accomplished its purpose, and ordinarily thereafter the issues are based on the return to the writ, and the transverse thereof. State ex rel. Chase v. Calvird, 324 Mo. 429, 434-5, 24 S.W.2d 111, 114. In this instance the relators here, when they were respondents below in the habeas corpus case, did file a motion to dismiss alleging voluminous facts, which was equivalent to a return challenging the court's jurisdiction.
1. A motion to quash a writ of habeas corpus serves only four purposes: (1) To set aside a writ obtained through fraud; (2) to determine whether there has been substantial compliance with the procedural requirements of the statute governing the issuance of the writ; (3) to determine if the matter is res judicata; and (4) to serve as a demurrer to test the sufficiency of the allegations of relator's petition. 25 Am.Jur., Habeas Corpus, §§ 130 and 136; State ex rel. Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111; In re Gilstrap, 171 Cal. 108, 152 P. 42, Ann. Cas. 1917A, 1086; Bleakley v. Barclay, 75 Kan. 462, 89 P. 906, 10 L.R.A.(N.S.) 230; Jensen v. Bevy, 103 Utah 220, 237-238, 134 P.2d 1081, 1089; Hardin v. Hardin, 168 Ind. 352, 81 N.E. 60. See, State ex rel. DuFault v. Utecht, 220 Minn. 431, 19 N.W.2d 706.
Its function is to advise the judge that someone probably is unlawfully or wrongfully detained or restrained of his liberty, to secure the issuance of the writ, and when that is issued the petition has 3-5 accomplished its purpose; — it is functus officio. In re Collins, 151 Cal. 340, 90 P. 827, 91 P. 397, 129 Am. St. Rep. 122, judgment affirmed Collins v. O'Neil, 214 U.S. 113, 29 S.Ct. 573, 53 L.Ed. 933; In re Williamson, 26 Pa. 9, 67 Am. Dec. 374; Addis v. Applegate, 171 Iowa 150, 154 N.W. 168, Ann. Cas. 1917E, 332; 29 C.J. p. 142; State ex rel Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111; In re Davenport, 114 Or. 650, 236 P. 758; 25 Am. Jur. p. 236. The proceeding proper is instituted by the writ of the court commanding the defendant to produce the body, and show by what authority he restrains or detains the body in whose behalf the writ is issued.
A respondent to whom a writ of habeas corpus is addressed can attack the petition if he desires by a motion to quash the writ. State ex rel. Chase v. Calvird, 324 Mo. 429, 24 S.W.2d 111, l.c. 114. The authorities hold that a petition for a writ of habeas corpus must on its face show probable cause for the issuance of the writ and when the petition fails to show grounds for the release of the infant, the court will not and should not issue the writ.
A substantial compliance with the statute is sufficient. State ex rel. Chase v. Calvird, 24 S.W.2d 111, 114. Petition insufficient in substance may be amended in the interest of justice.