Add search and pagination functions to top page