Api query branch pagination update

This should pretty much solve #85. Please do not merge yet, because we still have to figure out permissions for Submissions' index. Feedback/review would be appreciated.
Can you simplify this logic down? Seems like you're making basically the same call...?