added pagination and q search parameter