Replacing JSON.parse with a conditional parse in case the response from the JQuery.ajax call is returned as a parsed object