Fix pagination in API results. Performance fixes on data fetch.