search functionality is enhanced and a separate function is created which will handle all pagination request