1. For a form submit your server needs to return JSON data with at least a success flag, e.g {success: true} (unless you specified an errorReader that interprets the data differently).
2. For a file upload the response must be Content-type:text/html instead of application/json, which also means you have to encode HTML entities in the JSON data.