respond to html and json