The opinion of the court was delivered by
Garver, J. :This was an action brought by the defendants in error against the city of Concordia, to recover a balance alleged to be due for certain serv*36ices performed for the city in revising, compiling, and publishing in pamphlet form the city ordinances. This work was .done under a special contract entered into between the defendants in error and the mayor and council of the city, the city agreeing to pay therefor one-half the legal rate prescribed by law for the publishing of city ordinances in a newspaper. At the time the contract was made and the services were performed, J. M. Hagaman was a member of the city council of Concordia, and he and his two sons, as partners, were engaged in the newspaper and job printing business in that city. The work contracted for was well done, in a manner satisfactory to the mayor and council, and the compilation of the ordinances was received and used by the city. At the contract price the work amounted to $468, of which sum the city paid $200, and refused to pay any more. The court found that the work was reasonably worth $300, and gave judgment for that sum, less the $200 paid. The bill of particulars alleged that the services were reasonably worth the amount sued for, being the same as the contract price. The city defended by claiming that the contract entered into was “in violation of law, and was illegal and forbidden both by statute and by common law, on grounds of public policy, and that therefore plaintiff could recover nothing for the work done, either the contract price or the reasonable value thereof.”
Counsel for the city rely, in the first place, upon ¶2466, General Statutes of 1889, as prohibiting the contract in question and barring any recovery. This section is § 4 of chapter 132, Laws of 1867, and provides —
“That all officers, state and county, and all officers appointed or elected for the purpose of overseeing and *37directing any of the public improvements of the state, and all officers holding and exercising any office of trust or profit under and by virtue of any law of the state, be and they are hereby prohibited from taking any contract, or performing or doing, or having' performed or done for their own profit, any work in and about the office holden by them, or in or about any work over which they have in whole or in part the supervision, direction or control, and from furnishing any materials used in any such work. . . .”
The act is entitled “An act to restrain state and county officers from speculating in their offices.” On the part of defendants in error it is contended that this section cannot be construed so as to include city officers. With this contention we agree. The only language in the section quoted that can be held to be broad enough to include a city official is that contained in the phrase, “all officers holding and exercising any office of trust or profit under and by virtue of any law of the state.” Were it not for the restrictive title of the act, this language would warrant the construction claimed by the city. The legislature, however, saw fit, by the title, to limit the provisions of the act to state and county officers. It would have been an easy matter to have made the title comprehensive enough to include all public officials. The fact that the title was thus limited, clearly indicates that it was the legislative intention to restrict the act to these two classes of officers. Had this section made express reference to city officials, it would, to that extent, have been unconstitutional as violative of §16, art. 2 of the constitution, which requires that the subject of every bill “shall be clearly expressed in its title.” As said by Mr. Justice Brewer, in The State, ex rel., v. Bankers’ Association, 23 Kas. 499 :
‘ ‘ The constitution has said that the title must be *38an index to the law, and courts may not sanction as a valid enactment any part of a statute to which the finger of the title does not point. If we should attempt to enlarge the title, we should defeat the very purpose of the constitutional intention, which was to make the title of the bill notice of all contemplated legislation.”
Whatever might be said as to the scope of this section if considered alone, when it is read in connection with the title of the act it cannot be construed so as to include a class of officials entirely distinct from "state and county officers.” By no reasonable construction can a city councilman be held to be either a state or a county officer.
Our attention is called to the cases of Lawrence v. Killam, 11 Kas. 499, and Weston v. Lane, 40 id. 479, in which it is claimed, by counsel for the city, that the supreme court has given to> this statute the broad construction now contended for. An examination of those cases shows that no such question was in controversy, or decided, in either of them. The court, by common consent, seems to have assumed the correctness of the construction conceded in these cases. Hence, we do not think that we are precluded by anything said therein not in accord with the views of this court, now that the application of the statute is challenged.
A more serious question is the one raised by the objection to the court granting any relief to the defendants in error, on the ground that the contract entered into is illegal and void, as being against public policy, independently of any special statute on the subject. We think the court below correctly held the contract in question not binding upon the city. While, perhaps, not absolutely void, it was, at least, voidable at the option of the city, and at any time before its *39execution the city could, have refused to carry it out. One of the plaintiffs below, J. M. Hagaman, as councilman, was acting in the capacity of agent or trustee for the city. As such, it was his duty to supervise, and exercise his best judgment upon, all contracts entered into on behalf of the city. It was inconsistent with that duty for him to stipulate as to the terms for doing a thing for the city which his office required that he, as a representative of the city, should see done well and faithfully, and on the best terms.
There is little conflict in the decisions of the courts upon this proposition. Considerable diversity of opinion, however, exists upon the question whether the courts will allow compensation 'on the quantum meruit for services actually performed under such contract, and which have been appropriated for the benefit of the principal. On the one hand, it is claimed that there can be no recovery-upon the implied promise to pay what the services were reasonably worth, upon the ground that there can be no implied promise where there is no power to contract, or where the contract is, for any reason, illegal. To this effect are Smith v. Albany, 61 N. Y. 444 ; Stopes v. Greene Co., 72 Ind. 42 ; San Diego v. Railway Co., 44 Cal. 112. On the other hand, we think the better reason and authority permit a recovery, in the absence of express prohibition of law, on the quantum meruit, where the services contracted for and actually performed were proper and necessary, and no unfairness was used, or undue advantage taken, in obtaining the contract.
In considering the question of illegality of the contract, it is proper that a distinction be made between a contract which is illegal because its execution requires the performance of an immoral or unlawful act, or transgresses an express statutory prohibition, and *40one wherein the act to be performed is lawful, but the agreement is invalid because of the manner it was entered into, or because of incapacity to contract in either of the parties. The first receives no aid or encouragement whatever from, the courts, on the principle, “Ex twrpi causa non oritwr actio.” Of this character . were the contracts in the following cases: Gerlach v. Skinner, 34 Kas. 89 ; Hinnen v. Newman, 35 id. 712; Bowman v. Phillips, 41 id. 369 ; Sheldon v. Pruessner, 52 id. 579 ; Yount v. Denning, 52 id. 629 ; Oscanyan v. Arms Co., 103 U. S. 261, cited in the preceding case.
When the contract looks to the doing of a lawful act, but may be avoided by one of the parties to it because the oth,er party, at the time, acted in a fiduciary capacity for the first, the rule is applied in order to avoid the possibility of reaping any undue advantage from the contract. When it has been executed without objection, and actual benefits have been received under it, all parties acting in entire good faith, the law is maintained and the ends of justice subserved by disregarding those parts of the express agreement wherein advantage might have been taken, and allowing compensation merely for the reasonable value of the benefits received under it. Considerations of public policy do not require the doing of less than this. The defense of public policy has no element of punishment in it, nor is it allowed out of consideration for the defendant. It is upheld by the consideration which the law ever entertains for the protection of the public, and the settled policy of the courts to give no aid to the enforcement of contracts whose general tendency is injurious to the public, Hence, the courts refuse all relief to one who asks compensation for the doing of an act which is conclu*41sively presumed to be hurtful to public interests or morals. When, however, the thing accomplished is proper and beneficial, and not placed under the ban of any penal prohibitory enactment, the reason for the rule fails, and it should not be applied any further than is necessary for the public good. No rule which 'is applied for the prevention of wrong should be used to work injustice to either of two parties who have both been equally innocent of intentional illegality or wrong-doing. Principles based upon public policy fail in their object when used as instruments of Wrong. We are supported in this position by the following cases : Gardner v. Butler, 30 N. J. Eq. 702 ; Call Publishing, Co. v. City of Lincoln, 29 Neb. 149 ; Mayor of Macon v. Huff, 60 Ga. 221; Pickett v. School District, 25 Wis. 551; Spearman v. City of Texarkana, 58 Ark. 348 ; Ashhurst’s Appeal, 60 Pa. St. 290 ; Mayor of Niles v. Muzzy, 33 Mich. 61; Currie v. School District, 35 Miss. 163.
In Gardner v. Butler, supra, Van Syckel, J., said:
‘ ‘ It [the claim for compensation] must rest exclusively upon its fairness and justice, and be enforced upon the quantum meruit. That such is the full scope and effect of the rule and the extent to which the contract is annulled will be found by an examination of the cases. . . . The cupidity and avarice of the trustee is guarded against by giving the cestui que trust the right to repudiate the contract at all times when it is executory, and to allow simply a just remuneration, without reference to the contract price, when it is executed. The trustee thus derives no advantage from his breach of duty, and the company can suffer no detriment from his service in his behalf.”
The court, in Pickett v. School District, supra, expressed itself thus : r
‘ ‘ There seems ground for a distinction between con*42tracts which, are held to be against public policy, merely on account of the personal relations of the contractor to the other parties in interest, and those which are void because the thing contracted for is itself against public policy. In the latter class the parties acquire no rights which can be enforced either in the courts of law or equity. But in the former, the •thing contracted for being in itself lawful and beneficial, it would seem unjust to allow the party who may be entitled to avoid it, to accept and retain the benefit without any compensation at all.”
In Currie v. School District, supra, considering the contract of a director of a school district with the school board, Vandenburgh, J., said :
“ If chattels which the board is authorized to purchase for the use of the district are accepted and retained by the district, or by the trustees, it would seem just and reasonable that it should become liable for the reasonable value thereof, in the proper action therefor, though the contract of purchase under which they were delivered was unauthorized or unratified. The corporation should not be permitted to repudiate the contract, and retain the fruits of it.”
We think the views expressed in these cases commend themselves as more in accord with justice than to hold that all remedy or relief should be denied one who has, in good faith, given his services in the performance of things needful and necessary for the party seeking to repudiate all obligation therefor. The mayor and council solicited defendants in error to make the contract in question in this case. The evidence shows that they dealt honestly and fairly with the city, and gave it valuable and necessary service. We think they should receive the reasonable value of the work performed. The court below adjusted the differences of the parties upon this just and equitable *43basis. In doing so it committed no error. The judgment is affirmed.
All the Judges concurring.