Upon the hearing of the special proceeding the court may examine and determine the legality and validity of, and approve and confirm or disapprove and disaffirm, each of the proceedings for the organization of the district, including the petition for the organization of the district and all other steps and matters that may affect the legality or validity of the proceedings and objects set forth in the petition, including any proceedings connected with the voting and issuing of bonds by the district. The court in inquiring into the regularity, legality, or correctness of the proceedings shall disregard any error, irregularity, or omission that does not affect the substantial rights of the parties. The court may approve and confirm the proceedings in part and disapprove and declare illegal or invalid other and subsequent parts of the proceedings, and insofar as possible the court shall remedy and cure all defects in the proceedings. The court shall find and determine whether the notice of the filing of the petition has been duly given and published for the time and in the manner prescribed by this chapter. The costs of the special proceeding may be allowed and apportioned between the parties in the discretion of the court.
SDCL 46A-6-37