Make pages and per_page global