Refactored all of the controller logic to pull it out of the web server and into a dedicated controller class.
Moved the controller methods to a protocol with a default implementation and added a protocol for a serializer too which will allow for a certain amount of customization of the return object.