corrected the api calls in controllers