Helper functions to create paginated REST APIs in node.js.