moved from own pagination impl to flask-paginate