Loan Transaction: Legal Structure, Obligations, and Risk Allocation