Actions by the Secretary pursuant to the authority of this chapter shall be subject to chapter 7 of title 5, including that such final actions shall be held unlawful and set aside if found to be arbitrary, capricious, an abuse of discretion, or not in accordance with law.
Any request for a temporary restraining order against the Secretary for actions pursuant to this chapter shall be considered and granted or denied by the court within 3 days of the date of the request.
Any request for a permanent injunction against the Secretary for actions pursuant to this chapter shall be considered and granted or denied by the court on an expedited basis. Whenever possible, the court shall consolidate trial on the merits with any hearing on a request for a preliminary injunction, consistent with the provisions of rule 65(a)(2) of the Federal Rules of Civil Procedure, or any successor thereto.
Any injunction or other form of equitable relief issued against the Secretary for actions pursuant to section 1 5211, 5212, 5216, and 5219 of this title, shall be automatically stayed. The stay shall be lifted unless the Secretary seeks a stay from a higher court within 3 calendar days after the date on which the relief is issued.
Any exercise of the authority of the Secretary pursuant to this chapter shall not impair the claims or defenses that would otherwise apply with respect to persons other than the Secretary. Except as established in any contract, a servicer of pooled residential mortgages owes any  duty to determine whether the net present value of the payments on the loan, as modified, is likely to be greater than the anticipated net recovery that would result from foreclosure to all investors and holders of beneficial interests in such investment, but not to any individual or groups of investors or beneficial interest holders, and shall be deemed to act in the best interests of all such investors or holders of beneficial interests if the servicer agrees to or implements a modification or workout plan when the servicer takes reasonable loss mitigation actions, including partial payments.