refactors paginateRequest().
Merge pull request #31 from birkin/master

refactors paginateRequest().