Connect loan type logic to API