Fixed the API to return response as expected by autocomplete plugin