Api controller impl

Desperately need food so I'm gonna leave this here for now.  Definitely some sloppy stuff in here that could stand for some refactoring.

Also, the server that the supertest thing set up it doesn't tear down. Not sure how to fix that yet. Would love more eyeballs on this, I'm gonna take a break for a while.