An action was brought in the city court of Ogden City by the First National Building Company, a corporation, against N.J. Harris, the plaintiff herein, as an unlawful detainer of premises. A general denial and a counterclaim were filed by the defendant in the city court. The case was there tried on the merits, evidence as to the counterclaim refused on the ground that the pleaded counterclaim was not a proper subject of counterclaim, and judgment rendered against the defendant for $71.25 unpaid rentals, $115.50 as damages which were trebled and for interest, amounting in all to $425.85, and for costs and for restitution of the premises. The defendant in due time served and filed a notice of appeal, appealing from the judgment on both law and fact to the district court where the case was triable de novo. He gave an undertaking on appeal with two sureties, which, omitting formal parts, recited:
"Now therefore, in consideration of said appeal and of a stay of execution under the said judgment we the undersigned hereby undertake that if the judgment appealed from be affirmed or the appeal be dismissed the appellant will pay the judgment and the costs of appeal, the value and the use of the occupation of the property, and damages justly accruing to the Plaintiff during the pendency of the appeal not exceeding the sum of $860.00." *Page 23
The plaintiff "excepted to the sureties, and to the undertaking on appeal and in stay of execution, and to the form and sufficiency thereof, and demands that if such bond be found to be sufficient in form and substance, such sureties, and each of them, justify in the manner provided by law." Without justification of the sureties, the record of all of the proceedings in the cause was by the city court transmitted to the district court. There the plaintiff served and filed a motion for an order that the defendant be directed to "file a new and sufficient undertaking on appeal and in stay of execution in the said action," etc., in the sum of $100.00 for payment of costs on appeal; in the further sum of $851.70 for stay of execution of the money judgment appealed from; and in the further sum of $500.00, or such other amount as the court may fix, in stay of execution of the judgment for the possession of the real property," etc., and that the undertaking be to the effect that the defendant pay the amount of the money judgment appealed from, and all costs, if the appeal be withdrawn or dismissed, or the amount of any judgment and all costs that may be recovered in the action against the defendant, including the value of the use and occupation of the premises pending the appeal, and that, if the defendant did not make such payment or payments, judgment be taken against the sureties; and that the court direct that "either new and sufficient sureties be obtained on said undertaking, or that, if the sureties on the undertaking now on file, or either of them, be sureties, on the said new undertaking, said surety or sureties appear and justify as provided by law."
An order was made to that effect which later was set aside. Thereupon a new motion "for a new undertaking on appeal" was served and filed on substantially the same terms and conditions as stated in the prior motion, and that "said undertaking shall be in an amount not less than $1,451.70 consisting of the following particulars: The sum of $100.00 for payment of costs on appeal; the further sum of $851.70 for stay of execution of the money judgment appealed from; *Page 24 and in the further sum of $500.00, or such other amount as the court may fix, in stay of execution of the judgment for the possession of the real property," etc., the undertaking in other respects to be as stated in the first motion. On a hearing of that motion, the court over the objection of the defendant directed and ordered him within five days to give a new undertaking "in an amount not less than $1,451.70," to the effect that, if the judgment appealed from be affirmed or the appeal withdrawn or dismissed, the appellant "will pay the amount of the judgment and costs of appeal, the value of the use and occupation of the property, and damages justly accruing to the plaintiff during the pendency of the appeal," and that, if the defendant did not make such payment within thirty days after the entry of judgment in the district court or a dismissal of the appeal, judgment for such amount be taken against the sureties.
The defendant declined and failed to give such an undertaking whereupon the court on motion of the plaintiff dismissed the appeal. The defendant thereupon applied to this court for a writ of mandamus to require the appeal to be reinstated. We granted an alternative writ, and on return day heard 1-3 the matter on merits. A complete record on the return was transmitted to this court. It clearly was shown that the court on motion of the plaintiff and at his instance ordered and directed the defendant to give an undertaking in the sum of $1,451.70, to the effect that the defendant, in case the judgment was affirmed or the appeal dismissed, not only pay the costs on appeal but also whatever judgment was affirmed or rendered against him; and, because the defendant declined and failed to give such an undertaking, the appeal was dismissed. We think the court was not authorized to dismiss the appeal on such ground. It was the plain duty of the court to retain the case upon the giving of a proper cost bond in the sum of $100, though no undertaking staying the judgment in the city court had been given. The undertaking which was given may in some particulars be defective even as a cost bond, and defective and *Page 25 insufficient as a stay bond. But no motion was made to dismiss the appeal because of a defective of insufficient cost bond, or because the sureties had not justified. The motion made was that a new undertaking be given, not for costs, but for costs and also for a stay of the judgment appealed from. And the order was that such a bond be given in the sum of $1,451.70, and, because it was not given, the appeal was dismissed. An appeal from a city court to a district court is taken by the serving and filing of a notice of appeal, and is perfected by giving a bond in the sum of $100. When that is done, the record is transmitted and the cause transferred to the district court for trial de novo. If, on the motion for a new undertaking, the court was of the opinion that the undertaking which was given was defective or insufficient as and for a cost bond, the court could have required the defendant to give a proper cost bond in the sum of $100, and, if that was not done, the appeal could have been dismissed. If the defendant desired a stay of the judgment appealed from, and in the opinion of the court the undertaking which was given was insufficient for such purpose, the court could have required the defendant to give a proper stay bond, and, upon his failure to do so, the court could have set aside whatever order, if any, theretofore had been made staying the judgment appealed from and refused any further stay. But the failure or refusal of the defendant to give a proper stay bond was no ground upon which the court was justified or authorized to dismiss the appeal.
It is urged that the defendant did not offer to give a new or another cost bond, and should not now be heard to complain because the appeal was dismissed. The giving of a defective or insufficient cost bond was not the basis of the plaintiff's motion. The basis of the motion and the ruling invoked was that the defendant give a new undertaking in the sum of $1,451.70 for a stay of the judgment appealed from, including costs, and, upon his failure to do so, the appeal be dismissed. And that was the ruling which the court had no authority to make. The defendant was thus *Page 26 compelled to abide by the unauthorized order dismissing the appeal or seek relief for reinstatement of the appeal.
A further point is made as to parties. The cause for the writ was entitled alone against the district judge or court. It is urged that the First National Building Company, the plaintiff in the cause in the district court in which the appeal was dismissed, should also have been made a party. The writ 4, 5 was directed, and as it was required to be, to the district judge or court whose duty it was to perform the act sought to be enforced by the writ. Technically the only necessary parties to mandamus proceedings are the plaintiff who asserts the right to have the act done and the defendant upon whom rests the duty of performance. However, the practice is usual and proper to bring in all parties or other persons who are liable to be affected by the judgment, in order that they may have opportunity to be heard in their own behalf. 5 Bancroft, Code Practice Remedies, 5168; 18 R.C.L. 330. Though the First National Building Company was not made a party to the mandamus proceedings, still since it through its counsel appeared in such proceedings for and on behalf of the court or judge, and on his and its behalf resisted the writ and defended the ruling dismissing the appeal, the proceedings for the writ should not fail because the National Building Company was not formally made a party to the cause. Its counsel prepared and filed the return and all motions and pleadings on behalf of the judge or court, in oral argument and by brief presented the cause of his behalf and were permitted to present and presented all that could have been presented had the National Building Company been formally made a party.
It further is urged that mandamus was not the proper remedy; that the defendant had a remedy by appeal. Mandamus is a proper remedy to compel the court or judge to try a cause erroneously dismissed, and, where the district or 6 superior court improperly dismisses an appeal from a justice court, the writ of mandate lies to *Page 27 compel reinstatement of such appeal. 16 Cal. Jur. 826 and 835, and cases there cited; Silver City Merc. Co. v. DistrictCourt, 57 Utah 365, 195 P. 194.
Thus the writ heretofore granted is made permanent, and the district court directed and commanded to vacate and set aside the order of dismissal of the appeal and to reinstate it, and to proceed with the cause in accordance with the views herein expressed.
ELIAS HANSEN, FOLLAND, and EPHRAIM HANSON, JJ., concur.
CHERRY, C.J., not participating.