Updated code to allow just html content and json - for pluggable app