refs #1211, avoids separate db call for pagination
Merge pull request #1212 from fairmondo/refactor-unnecessary-query

refs #1211, avoids separate db call for pagination