used request_wants_html to get content according to mimetypes
changed request_wants_json to request_wants_html