Adds pagination and ajax to the search