added pagination on server side