Method to determine number of pages to be returned

Also, refactoring required to support this method.
Stop retrieval early when searching for single items in collections