add an option to change the number of pages shown

Previously there was no way to specify the number of pages returned by an API call (it would always return 10). This PR adds that option.