Implement pagination in the results of the searches

This commit relies on the previous change of the API to implement a pagination system so
that not all the results are returned and displayed in one page making it slow and heavy.