Refactored so we use the same controllers for the api and the UI, just changing the render engine.