Prints out XML string instead of JSON upon error