major: some changes to implementation of paginated query. next commit will remove obsolete dao apis and stuff