Upon the hearing of such special proceedings, the court shall have power and jurisdiction to examine and determine the legality and validity of, and approve and confirm, or disapprove and disaffirm, each and all of the proceedings for the organization of such district under sections 39-1601 to 39-1636 from and including the petition for the organization of the district and all other proceedings which may affect the legality or validity of the bonds. The court, in inquiring into the regularity, legality, or correctness of such proceedings, must disregard an error, irregularity, or omission which does not affect the substantial rights of the parties to such special proceedings. It may approve and confirm such proceedings in part and disapprove and declare illegal or invalid other and subsequent parts of the proceedings. The court shall, among other things, 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 in sections 39-1601 to 39-1636. The costs of the special proceedings may be allowed and apportioned between the parties in the discretion of the court. If the court shall determine the proceedings for the organization of the district and the issuing of the bonds legal and valid, the board of trustees shall then prepare a written statement beginning with the filing of the petition for the organization of the district, including all subsequent proceedings for the organization of the district and the issuing of the bonds, and ending with the decree of the court finding the proceedings for the organization of the district and the proceedings for the voting and issuing of the bonds legal and valid. The written statement shall be certified under oath by the board of trustees of the district.