we should probably add a check that req.query.page is within 1 and N where N is top most page for the result, but I think that belongs in another review. 

The way it behaves now, if you have say 10 pages, and you send in ?page=30 it will create a previous link pointing to page=29 instead of redirecting you to page=10 and creating previous:9 which is probably a cleaner solution, but I consider this a edgecase for now.