Make sure connector responses return application/json content type (unless not required)
Fix headers
Better check on ajax request than $_FILES
Make sure connector responses return application/json content type

* pr-11201:
  Better check on ajax request than $_FILES
  Fix headers
  Make sure connector responses return application/json content type (unless not required)