Fetching data in api controller