fixed the API to return response