Put all the response generation in a Helper module
Better content-type handling
Tuned up code and introduced Helpers