Made changes to API controller