Api query branch pagination update. DO NOT MERGE

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.
You should try to create a helper class or something, and then pass in different data values to it. 

Look at test_permissions to see something we used there.