(after stating the facts). — The declarations of law and the judgment given by the learned circuit judge indicate that he thought there could be no recovery, quantum meruitbecause the contract in suit is indivisible; but that the defendant had fully performed its undertaking and was entitled to the stipulated reward. The latter proposition demands examination from two standpoints. The theory put forward in the argument in support of the court’s conclusion is that the agreement contemplated an alternative performance by the defendant if the apples burned, by collecting the insurance money and turning it over to the owners. Suffice to say as to this proposition,that we find nothing in the conceded terms of the contract as stated in the answer, to support it. It is true the defendant is required to insure the fruit while in storage; but this requirement falls short of proving an undertaking that the defendant might earn the agreed charge by paying the insurance money to the owners if the fruit burned, instead of keeping and redelivering the fruit itself. Only one mode of complete performance was recognized by the contract, namely: storing the fruit until called for, and doing the other acts the defendant undertook to do.
The question of whether paying the owner as much money as could have been obtained by a sale of the apples at any time during the season, so far performed the *184contract that the equitable doctrine of substantial performance ought to be applied in defendant’s favor, has given us more difficulty. After much reflection our conclusion is that the contract was not substantially performed. A party may have an action on a contract, though he fails to execute it according to- its terms in all respects, if he so far executes it that the unperformed portions are trifling and failure to perform them in no way diminished the benefit the other party would realize from complete performance. Mo. Pac. R. R. v. Tygard, 84 Mo. 263; Gillespie Tool Co. v. Wilson, 123 Pa. St. 19; Leeds v. Little, 43 N. W. (Minn.) 309. The cases just cited afford instances of what has been held to be substantial as opposed to literal compliance with an agreement. In the Tygard case a subscription was made to aid in building a railroad on the condition that the railroad company should have its line in operation .to a designated point on or before January 1, 1881. The road was graded to the town by the specified time, but only completed to a connection with another road to a point a mile south of the town, over which road the plaintiff’s trains ran for four months until its own road was completed. There was held to have been a fair and substantial performance of the contract so as to lay the defendant liable on his subscription. It was ruled that only a fair and substantial compliance with the conditions of a contract is required in order to maintain an action on it. That case shows, too-, that the doctrine of substantial performance, though usually allowed in building contracts where a party has erected an improvement on the land of another not exactly in compliance with an agreement between them, is applicable, under appropriate circumstances, to undertakings of a different character. In Leeds v. Little, it was said' that in contracts for the sale of real estate if the difference or deficiency in certain respects between the property contracted for and that tended for conveyance, is slight in substance and not material to the enjoyment of *185the property, the matter should be treated on equitable principles. We grant that this defendant was prevented, without fault on its part, from literal compliance with its agreement; which fact must exist to justify the application of the doctrine of substantial performance. Gillespie Tool Co. v. Wilson, 123 Pa. St. 19. If it appeared without dispute that the only object the owners had in depositing their apples in the defendant’s cold storage rooms, was to preserve the fruit until the state of the market made a sale expedient, the argument would be more plausible that, inasmuch as the owners, in consequence of defendant’s services, received as high a price as they could have got by selling the apples, the defendant substantially executed its agreement. Even then Ave think the argument would be unsound; for instead of the defendant’s promises having been kept, the true view Avpuld be that they Avere not kept, but, by good fortune, the promisees sustained no loss in consequence of the failure to keep them. The view is inadmissible that an agreement to keep property untii the o-Avner wishes to sell, and covered meanwhile by insurance, is substantially performed, in case the property burns, by paying the bailor the insurance money. The period for which storage is hired may be several months, as it was in the present instance, and the fire may occur the day after the property is stored. Manifestly such an agreement is not performed in a true sense, merely because the insurance on the property saves the owner from loss. Substantial, as well as complete, performance means performance according to the terms of the agreement; not the doing of some act which is as advantageous financially to the promisee as the agreed act would have been. To give such an application to the rule of substantial performance would be to hold that a party who agrees to do a certain thing, may discharge fris duty by doing any other thing equally profitable to, but perhaps never desired by, the obligee. In the case before us it does not appear that the only purpose of the owners of *186the apples was to preserve them while waiting on the market. Likely that was their purpose; but the fact was not proved and cannot be assumed. They may have intended to use the apples themselves. Various motives may have induced them to put the fruit in cold storage, and we have no right to say the motive was to wait until the state of the market made it desirable to sell. At any rate, they contracted with the defendant to keep the apples until called for not later than May first,, and for the rendition of other services in connection with the fruit, including the taking out of insurance. A contract for those services is not executed by collecting and accounting for the insurance money. In Hopper v. Burness, C. P. Div. 137, the master of a vessel was compelled to sell, at an intermediate port, a shipment of coal in order to raise money to repair the vessel. Though it was held the sale was justified by maritime law, and though' the coal realized more than the shipper would have got by selling at the port of destination, the shipowner was denied freight charges on the ground of non-performance of the charter party. Our conclusion is that the contract in question was neither technically nor substantially complied with by the defendant. Therefore the rule of law, which prescribes that a party who contracts to do something does not earn the promised consideration if performance becomes impossible, deprived the defendant of right, under the contract, to retain the stipulated compensation. As the court below declared the law otherwise, we must hold the declarations were erroneous. But the declarations were given as requested by the plaintiff and he cannot complain of them. He can complain of the finding that the contract was fully kept by the defendant; and as the case must be retried on account of that finding, it is proper to go fully into the law bearing on it.
The reason assigned for the rule in question is that the obligated party might have, inserted' a term in the agreement excusing further performance and allow*187ing compensation for what had been done, in case an untoward event made complete performance impossible. So he might if he could have thought of it; but the conviction is produced by studying the cases, that men rarely include such exceptions in agreements; either from want of foresight, or because, though they fail to so stipulate, their understanding is that if compliance is prevented by a catastrophe, the obligation to comply shall cease without prejudice to the right of the prevented party to remuneration for the value of services already rendered. The aim of the courts in upholding the rule is to enforce agreements according to the intention of the makers. But often it has brought to pass consequences never thought of and worked great hardship. The idea that the rule is designed to give effect to the object of agreements should be held in mind as the key to the correct use of it. There is no arbitrary regulation, enforced from motives of public policy, that a man shall get nothing for what he did in good faith toward discharging an undertaking that, from necessity, he was compelled to leave incomplete. When not hampered by private conventions the law inclines to hold otherwise. Hence, whether or not the doctrine in question precludes recovery in a given cause depends on the interpretation of the agreement between the parties. Wolfe v. Howes, 20 N. Y. 197; Baily v. de Crespigny, L. R. 4 Q. B. 180; Hall v. School Dist., 24 Mo. App. 213. A court’s first duty is to ascertain what was expected to be the effect on the right to remuneration, if some event put complete execution of the contract beyond human power, after one party had rendered valuable services to the other by partial performance. It is to be considered whether, in such contingency, the contract provides for payment of the stipulated consideration just as if there had been a complete compliance, or permits a recovery quantum meruit for beneficial services rendered and accepted, or precludes any recovery at all. The proposition is stated in the following words in a *188standard authority: “In what cases may an action be brought by a person who has entered into a special contract, against the person with whom he has contracted, while the plaintiff’s own side of the contract remains unperformed?” 2 Smith’s Leading Cases (9 Ed.), 1220. Transposing that question so as to meet the form in which the present case is presented, we ask if the circumstances in proof entitle this defendant to retain, as the reward of services rendered under a special contract, any part of the insurance money due the owners of the fruit, the defendant having failed, without fault on its part, to do everything it had bound itself to do? We have consulted a large number of decisions on this subject, but with slight hope, from the outset, of reaching a satisfactory conclusion. Text-writers and courts agree that the authorities bearing on the proposition are in hopeless discord. ^It is said that the intention to make the right to compensation depend absolutely on complete performance ought to be clearly expressed to justify a court in so holding; for the denial of any payment for meritorious service is opposed to natural equity. Leonard v. Dyer, 26 Conn. 172; Huyett, etc., Co. v. Edison Co., 59 Am. St. Rep., note on page 283. The court below held that there could be no recovery, quantum meruit, because the consideration for the contract was a round sum- and not apportionable; wherefore the contract was entire and indivisible. We agree that the defendant was to render the several services of unloading, repacking, storing, insuring, reloading and icing the apples, for the single consideration of fifty cents a barrel, and that this consideration could not be apportioned so as to provide separate compensation for the different items of service. But though the fact that the consideration for a contract cannot be distributed, conduces to show the contract is entire, it is not conclusive of the matter; for if it otherwise appears the parties intended the stipulations of the contract to be severable, they will be so construed notwithstanding the entirety *189of the consideration. Huyett, etc., Co. v. Edison Co., 59 Am. St. Rep., note, page 278. The true test of the entirety of a contract is the intention of the parties as gleaned from the language employed and the subject-matter of the agreement. Leonard v. Dyer, 26 Conn. 172; Pollak v. Association, 128 U. S. 446; Morris v. Wybaux, 159 Ill. 627; Champlin v. Rowley, 8 Wend. 194. Moreover, the distinction between entire and severable contracts controls the decision of the question whether its stipulations are dependent and performance of all of them a condition precedent to any right of action on the contract, or independent. In the latter case sometimes an action can be maintained on one or more of the stipulations, though the others have not been performed. The distinction bears principally on the right to sue on the contract itself, and does not altogether determine the right to sue. on the common counts. We do not understand that there can be no recovery quantum meruit, under any circumstances, if the contract is entire, even when complete performance was impossible and partial performance was beneficial to and accepted by the other party. Derott v. Jones, 23 How. (U. S.) 220; Bishop, Contracts, (1887 Ed.), secs. 1420, 1421, 1444; 2 Parsons, Contracts (9 Ed.), bottom pp. 678, 679, 812. Speaking generally we may say the law is that there can be no recovery in an action on a contract, for work done pursuant to it, until all the agreed work is done, unless completion was prevented by the obligee. But that there never can be a judgment quantum meruit if complete performance is rendered impossible by some contingency for which the party bound is no sense to blame, is an untenable position on the modern cases. When such a contingency arises, we apprehend that the right to recover quantum meruit is controlled by various factors; such as compulsory failure of the promisor and voluntary acceptance of benefits by the promisee. So, too, the language of the agreement may preclude or explicitly authorize *190or permit a recovery quantum meruit. If the language of the parties leaves the court free, the implication of an agreement to pay will he raised or not according to whether the service was beneficial to the party sued and accepted by him/ Even where the special contract remained open for further performance, there have been instances in which the defaulting party was allowed a recovery for what he had done, on the ground that his work had been of benefit to the other side and accepted. This compensation is awarded then on the theory that the one benefited intended to remunerate the other party for his work. Dermor v. Jones, 23 Howard 220. Now, in the present case the apple owners contracted for storage until May first, on the supposition that the apples would continue in existence to that date. In other words, the obligation of the defendant to completely comply with the agreement, depended on the existence of the property through the season. Therefore, when the property was destroyed this ■contract was no longer open for performance; and in an action against the defendant for failure to keep the fruit until called for, undoubtedly there would be no liability. The law excuses a bailee from restoring property •under such circumstances. But this is not an action of that sort, but one against the defendant to recover money withheld to satisfy storage charges. In essence, however, the case turns on the defendant’s right to compensation for what it did, and, its right is contested on the ground that it failed to do all it agreed to do— which usually a party must do to maintain an action on a contract. There is nothing in the language of this contract to negative the idea that the defendant should receive some compensation if, without fault on its part, entire performance became impossible; as there is nothing to show it should receive the full compensation. The possibility of the destruction of the fruit by fire was contemplated from the first and the defendant was required to protect the owners against loss by such a *191calamity at his own expense. Furthermore, the defendant, at the instance and request of the owners of the apples, collected the insurance money for them — -an act of service which the contract did not, in terms require. Now is it reasonable to say those servies, in addition to preserving the apples for two months or more, were expected to be rendered by the defendant for nothing? Or, is it reasonable, on the other hand, to say remuneration was intended? We think the latter is the just and reasonable conclusion to be deduced from the agreement and the acts of the parties. All the cases and writers agree that implied terms and intentions, must be recognized in litigation of this character, when implications fairly arise on the facts. Mo. Pac. R. R. v. Tygard, 84 Mo. 263; Hall v. School Dist., 24 Mo. App. 213; Stewart v. Stone, 14 L. R. A. 215, 127 N. Y. 500; Leake, Contracts, 692; Pollock, Contracts, 364. Leake states the rule as follows:
“Where the performance of the promise becomes impossible subsequently to the making of the contract, the question whether the contract remains applicable to the subsequent impossibility, or on whom the consequences of. such impossibility shall fall, depends upon the intention of the parties to be collected from the terms of their agreement, as construed with reference to the circumstances. The agreement may show an intention to bind the promisor for the act or performance in all events; or it may show an intention to. contract with reference to a particular state of facts then existing, and not with reference to the different state of facts subsequently supervening; limiting its effects, under the circumstances, to certain events only, and excepting others. These are questions of construction with reference to the circumstances.”
Pollock says the real question the court always has to decide is whether the contract is, in substance and effect as well as in terms, unconditional and without an implied, exemption for inevitable accident. The ad*192judged cases show there.is a conflict between the rule that a party who accepts beneficial services from another must pay for them and the rule that a party who agrees to do certain acts for a round sum must, despite a supervening impossibility, perform his agreement in order to recover. The struggle of the equitable rule for ampler recognition has introduced confusion into the law. Which rule shall control the decision of a case depends as stated, partly on the words of the agreement, partly on the benefit of the services and their voluntary acceptance by the benefited party. The implication of an intent to reward for partial service may -be gathered, in this case, from the circumstance that the defendant was required by the contract to carry insurance on the property for the benefit of the owners, which proves all parties contemplated that full service by storing through the entire period to May 1st, might become impossible. Some weight, too, should be given to the circumstance that, at the instance and request of the owners of the fruit, the defendant performed a service after the destruction of the property it was not bound to perform.
We have been cited to cases bearing strongly on the one at bar. Archer v. McDonald, 36 Hun 194; Cunningham v. Kenney, 105 Calif. 118. In the Archer case it was held that as the defendant’s property was destroyed while in storage, the bailee could recover nothing for caring for it, because he had contracted to redeliver it. In the California case there was no contract to redeliver, but the court held the bailee was bound by law to return it. If it was meant that a bailee is bound so absolutely to return bailed property that he. is liable for not d'oing so even if the property is destroyed without his fault, we answer that the law is otherwise. McEvers v. Steamboat, 22 Mo. 187; Van Zile, Bailment, sec. 200. No case we have seen resembles this one in providing for insurance at the expense of the bailee. In other words, the contract did not show the parties had *193in mind the possible destruction of the property and required the bailee to take trouble and expense to save the bailor harmless in that event. Certainly it is an extreme view that such trouble and expense were expected to be given gratuitously. Underlying the various cases in which the bailee was denied remuneration, is the thought that the owner sustained an entire loss and, therefore, ought to make no compensation to the bailee, whom the law excused from responsibility as the loss occurred without his fault. On the other hand, there is a line of cases in which no recovery was allowed for services in connection with the lost property, because it was thought the language of the contract precluded compensation, quantum meruit or otherwise, unless full performance occurred. Stonam v. Waldo, 17 Mo. 489; Hopper v. Buraess, 1 C. P. Div. 137. Still another line of cases denied compensation to the defaulting party on the ground that, though beneficial services were rendered to the other party, the latter did not voluntarily accept the services, but only involuntarily accepted them; because, to reject them, he would have had to refuse to accept his own property. Smith v. Brady, 15 N. Y. 173 and citations in the opinion; Metcalf v. Iron Works, 1 Q. B. Div. 613, 2 Q. B. Div. 423. This distinction is touched on the Yeats v. Ballentine, 56 Mo. 530, 538. In Missouri persons who did work under a building contract but abandoned the job before completing it, have been awarded judgments quantim meruit,leaving the owner to his action or counterclaim for damages suffered by the abandonment. Yeats v. Ballentine, supra; Rude v. Mitchell, 97 Mo. 365. It seems that a contract for personal services abandoned without necessity, stands, in this State, on a different footing from other contracts. See opinion in Moore v. Gaus Mfg. Co., 113 Mo. at page 108 in comment on Earp v. Tyler, 73 Mo. 617. In the Metcalf case the master of a vessel which had been chartered to carry freight to a certain *194port, found the port blockaded with ice, and instead of waiting for the ice to break up and then proceeding on his voyage, landed the cargo at the port nearest the port of destination that' he could reach, and afterwards claimed pay for transporting the cargo as far as he did. In that instance the owner, or rather the consignee of the cargo, received it under protest where it was discharged. Compensation was denied to the ‘Shipowner as there was no voluntary acceptance of the goods at the port where they were unloaded. As illustrating the other phase of the question, namely, where the obligee is under no necessity to accept the benefit of the partial performance and is liable for its value if he does, see Thompson v. Allsman, 7 Mo. 531. In the present case meritorious services were rendered by the defendant to the fruitowners, these services were contemplated as a possibility from the first and at least one act of service was performed at their request which the defendant was not bound by agreement to perform. The service was voluntarily accepted by the owners and proved highly beneficial to them after full performance by the defendant had become impossible without its fault. That the defendant was blameless, that its services were beneficial to the owners of the fruit and voluntarily accepted by them and that the language of the contract and the circumstances permit the implication of a promise to pay, are the vital facts. No essential element is lacking of an implied promise to compensate the defendant quantum meruit.
But what compensation ought the defendant to receive? Not necessarily the full price stipulated; but whatever is found to be the reasonable .value of the benefit accruing from what the defendant did, not exceeding the stipulated price. For aught that appears the fruitowners received as much benefit as they would have received had the apples remained in storage as long as agreed. This, however, was an accident. It could have happened as well that, instead of the insurance *195money covering the value of the apples at the highest market price during the season, it fell short. The reasonable value of the services rendered by the defendant is a question of fact and must be determined by the triers of the fact; and for this reason the cause will have to be returned for a second trial. We. are not prepared to say the principle’ of some of the cases cited by plaintiff’s counsel cannot be extended logically to embrace the present controversy and deprive the defendant of any compensation. But no authority contains the paramount facts of the carrying of insurance for the benefit of the bailors, collecting it after the destruction of the property and paying it over to them. The precedents do not compel the ruling that the defendant .should have no remuneration for what it did and we are unwilling to carry the rule beyond them. Besides, we think this controversy rightly can be held to fall within the principle and reasoning of such Missouri decisions as Marsh v. Richards, 29 Mo. 105; Moore v. Gaus Mfg. Co., 113 Mo. 98, 20 S. W. 975, and others.
The judgment is reversed and the cause remanded.
Nortoni, J., concurs, Bland, P. J., not sitting.