Fixes issue 216.

Use query limit/offset on query instead of query result.
Merge pull request #225 from dnordberg/master-issue-216

Fixes issue 216: Paginated responses are extremely slow