Adds support for json responses.
Simply add a ?json to the end of the url to retrieve data from the
controller. It will create a json string of all class variables