Fixed issue with returned content not in JSON 

If the body is not in proper JSON (e.g. the service returns an HTML file with an error in it instead of proper JSON - which was the case with the JIRA server) the script fails badly. This fix takes care of that.