ensure that formdata requests return JSON data from the server