add support to paginate results from search api endpoint