Clean up code that isn't needed
Add support for returning a json response