respond to JSON, HTML