Added mysql support for saving eexisting loans, and querying them with an api