work query: fix pagination and add order/direction