Refactor PUT/POST to MongoDB a tiny bit

Hopefully in the future this can be used for DELETE too.
Make the router slightly less HTTP specific