Backend stuff

I refactored some stuff to add the ability to add actions to specific apis, by creating a function in the class.

Also, I made pagination better. I just use pages right now.

There still needs to be more done in the frontend, but basic pagination actually works now!

@sharadmv can you look at this?