add filtering and pagination functionality