Brian Sparks and Julie Sparks (“Homeowners”) appeal from the trial court’s judgment sustaining Millsap & Singer, P.C. (“Millsap PC”) and Millsap & Singer, LLC’s (“Millsap LLC”) (collectively, “Respondents”) motion to dismiss all counts against them. Homeowners had filed a suit against Respondents as well as PNC Bank, N.A. (“PNC Bank”), arising out of an attempted foreclosure on their home, alleging the foreclosure was wrongful and the trustee’s duties were breached. We affirm the trial court’s dismissal of Homeowners’ claims against Respondents.
I. Background
Homeowners filed their original petition in this matter on August 5, 2011, alleging claims against Respondents and another defendant, PNC Bank, arising from a note and deed of trust executed by Homeowners in favor of their lender, National City Mortgage Company (“National City”). The deed secured a loan made by National City to Homeowners for $142,500, by acting as a lien against Homeowners’ property located in Beaufort, Missouri.
Homeowners alleged that in early 2009, they began to worry about their ability to make their mortgage payments as required by the note. Homeowners sought a modification of the note with National City, and later its successor by merger, PNC Bank. In August 2010, Homeowners received notice from PNC Bank that they were ineligible for modification, and in September 2010, they received a letter from PNC Bank indicating their home had been placed in foreclosure due to their failure to make the required payments on the note. Shortly thereafter, Homeowners received a foreclosure letter from Millsap PC, informing Homeowners of the need to pay a reinstatement amount to avoid the foreclosure sale. Homeowners alleged they were urged by Respondents to resolve any disputes regarding their account or modification status with their lender. Although Respondents timely notified Homeowners of a scheduled October 15, 2010 foreclosure sale, no foreclosure sale of their home ever took place because Homeowners paid $13,162.10, the reinstatement amount necessary to reinstate their loan, with the exception of a discrep*457ancy amount involving the fee charged by Respondents.
Respondents filed a motion to dismiss, resulting in the trial court’s order that Homeowners amend their original petition. Homeowners filed their Amended Petition on November 21, 2011, seeking relief against Respondents in Counts III, for negligence, and IV, for unjust enrichment. Counts I and II sought relief against PNC Bank. Neither the deed of trust nor a mortgage modification document was attached to the original petition or the Amended Petition filed by Homeowners. The motion to dismiss was considered again against the Amended Petition and the trial court dismissed Respondents from the lawsuit. Homeowners filed a motion for reconsideration, which was denied by the trial court. The trial court certified its order as a judgment and this appeal follows.
II. Discussion
Homeowners raise two points on appeal. In their first point, they allege the trial court erred in granting Respondents’ motion to dismiss because the elements of negligence were pleaded in that Homeowners alleged in their Amended Petition that Respondents, as trustee, had numerous legally recognized duties under Missouri law, including a duty to be impartial, a duty to conduct a reasonable investigation, a duty to avoid unfair dealings, and a duty to guard against unusual circumstances. Homeowners pleaded that Respondents breached each of these duties, resulting in financial and emotional harm to Homeowners.
Second, Homeowners argue the trial court erred in granting Respondents’ motion to dismiss Count IV because the elements of unjust enrichment were pleaded in that Homeowners alleged that Respondents incurred a financial benefit at the expense of Homeowners and it would be unjust for the Respondents to retain the benefit since the Respondents violated their duties as a trustee.
A. Standard of Review
An appellate court applies de novo review on a trial court’s grant of a motion to dismiss for failure to state a claim. Weber v. St. Louis Cnty., 342 S.W.3d 318, 321 (Mo. banc 2011). The Missouri Supreme Court has set forth the standard for reviewing a dismissal for failure to state a claim upon which relief can be granted:
A motion to dismiss for failure to state a cause of action is solely a test of the adequacy of the plaintiffs petition. It assumes that all of the plaintiffs aver-ments are true, and liberally grants to plaintiff all reasonable inferences therefrom. No attempt is made to weigh any facts alleged as to whether they are credible or persuasive. Instead, the petition is reviewed in an almost academic manner, to determine if the facts alleged meet the elements of a recognized cause of action, or of a cause that might be adopted in the case.
Nazeri v. Mo. Valley Coll., 860 S.W.2d 303, 306 (Mo. banc 1993).
B. Homeowners failed to plead trustee’s legal obligations under mortgage documents
Homeowners’ Amended Petition alleged Defendant PNC Bank, as successor to National City, “was responsible for honoring the mortgage modification agreement” that Homeowners had in place with National City. No “mortgage modification agreement” or deed of trust is contained in the record. Additionally, Homeowners alleged Defendants Millsap PC and Millsap LLC, successor trustee and foreclosure attorney, failed to adequately represent Homeowners’ interests in this transaction.
*458A mortgagee may appoint, not only a trustee, but a successor trustee, and prescribe the conditions upon which such successor may take the place of the original trustee. A successor trustee is a substituted trustee with only such powers as the deed of trust instrument gives him, and he becomes such only upon the happening of a contingency therein named. Adams v. Boyd, 332 Mo. 484, 58 S.W.2d 704, 707 (1933). The trustee’s power to sell under a deed of trust is a matter of contract between the parties on the conditions expressed in the instrument, and does not exist independent of it. Id. (citing Kelsay v. Farmers’ & Traders’ Bank, 166 Mo. 157, 65 S.W. 1007 (1901)). Moreover, under Missouri law, any modification to a contract that falls within the statute of frauds must also be in writing to be enforceable. Melson v. Traxler, 356 S.W.3d 264, 273 (Mo.App. W.D.2011).
The appointment of a trustee is triggered by the request to sell the property when the mortgagee directs it. As explained by our courts more than one hundred years ago, the trustee’s duties to both parties are “[i]n all matters connected with a foreclosure of the trust deed,” and must be exercised “within the terms of the instrument under which he was acting in their behalf.” Hull v. Pace, 61 Mo.App. 117 (Mo.App.1895). Such duties include an equal duty of fairness and impartiality to both parties when accepting the direction by the mortgagee to sell the property. Boatmen’s Bank of Jefferson Cnty. v. Cmty. Interiors, Inc., 721 S.W.2d 72 (Mo.App. E.D.1986). The duty of fairness and impartiality is breached only when the trustee, in disregard of a timely objection by one of the parties, proceeds to advertise and call the sale in an unusual manner prejudicial to that party and favorable to the other. Spires v. Edgar, 513 S.W.2d 372, 378-79 (Mo. banc 1974). When requested by the creditor to foreclose, the trustee may proceed without making any affirmative investigation unless the trustee has actual knowledge “of anything which should legally prevent the foreclosure.” Id. at 378. (emphasis added) (finding “no case where a trustee has been held liable in damages for a failure to make an investigation of the default before foreclosure”).
To illustrate such principle, is Killion v. Bank Midwest, N.A., a suit against a bank and trustee of a deed of trust arising from an attempted foreclosure based on the borrowers’ default for failing to pay contingent interest that was later found to be unlawful. 987 S.W.2d 801, 813 (Mo.App. W.D.1998). In Killion, the Western District ruled that even though the trustee knew all the facts asserted by the borrowers to preclude foreclosure, none of them provided a legal basis for preventing the institution of the foreclosure proceedings based on the borrowers’ default and the right to foreclose under the deed of trust. Id. The court held the borrowers did not make a submissible case on their breach of fiduciary duty claim against the trustee. Id. Further, our courts have held that, excluding cases involving fraudulent conduct by the creditor or trustee, even the debtor’s tender of payment may not legally prevent a foreclosure sale after a mortgagee has exercised his option to accelerate a mortgage on default of an installment when an acceleration clause is contained in the note and the deed of trust. Thielecke v. Davis, 260 S.W.2d 510, 511-12 (Mo.1953).
In light of the law indicating Homeowners’ claims arise out of the trustees’ duties as outlined by their contracts with the lenders, we next look to Missouri Supreme Court Rule 55.22. This rule provides:
When a claim or defense is founded upon a written instrument, the same *459may be pleaded according to legal effect, or may be recited at length in the pleading, or a copy may be attached to the pleading as an exhibit.
Rule 55.22; Mo. Farmers Ass’n, Inc. v. Todd, 667 S.W.2d 736 (Mo.App. E.D.1984).
To demonstrate this rule in practice, in Hudspeth v. Tree Mart, Inc., 573 S.W.2d 697, 698 (Mo.App.1978), a suit to recover unpaid interest and principal due on a note, the plaintiffs petition alleged the corporate existence of the defendant, the execution of the note for consideration, the terms of the note, the plaintiffs status as holder of the note, and the amount due. This Court deemed the pleading sufficient and held that the defendant did not specifically deny the signature on the note as required, and the trial court properly awarded summary judgment. Id.
In the case at bar, Homeowners allege that Respondents were provided actual knowledge of PNC Bank’s actions, including its decision to dishonor a promised mortgage modification by National City, the fact that Homeowners were in active modification review, and the fact that PNC Bank repeatedly suggested that Homeowners should continue to check back into the status of the loan modification and foreclosure proceeding. Homeowners allege that despite this knowledge of the loan irregularities, Respondents proceeded toward foreclosure, “following orders” and breaching their duty to Homeowners. Upon our review, we find nothing in Homeowners’ Amended Petition alleging a legal reason that should prevent Respondents from continuing forward with the foreclosure. Thus, Respondents had no legal duty to make an investigation.
This Court’s ruling does not give trustee’s free reign to behave as they wish with immunity from claims, without abiding by their duties of fairness and impartiality, as Homeowners suggest. Rather, we reiterate the same principle stated by the Missouri Supreme Court in Spires: should the trustee gain actual knowledge “of anything which should legally prevent the foreclosure,” the trustee then may not proceed with the foreclosure without making an affirmative investigation of the same. Spires, 513 S.W.2d at 378. Accordingly, the mortgagor’s claims against the trustee would be derived from the deed of trust or legal documents outlining the terms of the mortgage agreement and, specifically, what legally prevents foreclosure.
Even assuming, arguendo, that the trustee here had a duty to investigate, no reason for such was made known to the courts based on Homeowners’ pleadings. A trustee’s duty to investigate here may have arisen from a deed of trust or modification document providing the legal basis for foreclosure or prevention of foreclosure. No such documents, or their legal effects, were pleaded. Notwithstanding Homeowners’ lengthy recitation of the background of the mortgage system and the trustee’s role in non-judicial foreclosure proceedings, Homeowners throughout their case have attempted to ignore the link between a trustee’s power of sale clause contained in mortgage documents to one’s related duties of' impartiality and fairness arising out of the same documents, vis-a-vis the same duties involving foreclosure of the deed of trust. Accordingly, under Rule 55.22, Homeowners had the option, in stating any averments within the dismissed Count III (negligence) and Count IV (unjust enrichment) arising from the mortgage documents or modification agreement, to either (1) state the legal effect of such agreements in relation to Homeowners and Respondents, (2) recite the agreements in their entirety within the counts, or (3) attach a copy of the agreements to the Amended Petition. Home*460owners did not do any of these. Nowhere in Counts III or IV does there appear a phrase stating Respondents’ legal obligations under the agreements, nor were they quoted or attached to the Amended Petition. “Consequently, the provisions of the [mortgage documents or modification agreement] were not for consideration by the trial court nor this court in deciding whether the petition stated a cause of action.” State ex rel. E.A. Martin Machinery Co. v. Line One, Inc., 111 S.W.3d 924, 930 (Mo.App. S.D.2003).
C. Homeowners also failed to plead ultimate facts showing they are entitled to relief
Even though we find the trial court properly dismissed Homeowners’ cause of action based on the foregoing analysis, we note that because the trial court’s judgment was devoid of any reasoning for its decision, we can affirm the judgment for any reason stated in the motion to dismiss. Wenthe v. Willis Corroon Corp., 932 S.W.2d 791, 793-94 (Mo.App. E.D.1996). Homeowners’ failure to comply with Rule 55.05 is another such reason.
Rule 55.05 requires a pleading that sets forth a claim for relief to contain: “(1) a short and plain statement of the facts showing that the pleader is entitled to relief and (2) a demand for judgment for the relief to which the pleader claims to be entitled.” Thus, plaintiffs in a case must plead “ultimate facts” of their case. M & H Enters, v. Tri-State Delta Chems., Inc., 984 S.W.2d 175, 181 (Mo.App. S.D.1998). A petition must contain allegations of fact in support of each essential element of the cause sought to be pleaded. Berkowski v. St. Louis Bd. of Election Comm’rs, 854 S.W.2d 819, 823 (Mo.App. E.D.1993).
Homeowners’ allegations in Count IV for unjust enrichment contain a statement that they have suffered economic and emotional damages, including but not limited to loss of retirement income, damaged credit rating, and stress, embarrassment and humiliation, as well as amounts paid to Respondents. However, the Amended Petition is unclear whether Homeowners allege that such reinstatement payment was not actually due. The right to restitution for unjust enrichment presupposes: (1) that the defendant was enriched by the receipt of a benefit; (2) that the enrichment was at the expense of the plaintiff; (3) that it would be unjust to allow the defendant to retain the benefit. Petrie v. LeVan, 799 S.W.2d 632, 635 (Mo.App. W.D.1990). Here, the Homeowners have alleged that they voluntarily made the reinstatement payments, and that Respondents received the payment; however, it is unclear from their pleading why it would be unjust to allow Respondents to retain the benefits.
“The third element [of an unjust enrichment claim], unjust retention of the benefit, is considered the most significant and the most difficult of the elements. Mere receipt of benefits is not enough, absent a showing that it would be unjust for the defendant to retain the benefit.” US Bank Nat’l Ass’n v. Cox, 341 S.W.3d 846, 852 (Mo.App. W.D.2011) (quoting Adams v. One Park Place Investors, LLC, 315 S.W.3d 742, 749 (Mo.App. W.D.2010)). As it was pleaded here, the Homeowners were able to keep their home while the Respondents were paid the reinstatement and attorneys fees owed to them for their work and the mortgage payments. Without finding that Respondents breached their duties to Homeowners, we further cannot find Respondents unjustly retained the benefits based on any breach, as alleged. Thus, “there can be no unjust enrichment if the parties receive what they intended to obtain.” Id. at 853.
*461We find the Homeowners’ Amended Petition failed to state a cause of action and was properly dismissed. Both of Homeowners’ points on appeal are denied.
III. Conclusion
The judgment of the trial court is affirmed.
ROBERT G. DOWD, JR., P.J., and ANGELA T. QUIGLESS, J., concur.