Make loans feature test pass

fix create loans functionality
fix edit loans functionality