Change content type to 'application/json' instead of outputting in a textarea