code: function parseJson(text) {
    try {
      var o = JSON.parse(text);
      if (o && typeof o === "object" && o !== null)
        return o;
    }
    catch (e) {}
  
    return text;
  }
docs: Return parsed JSON if needed, otherwise returns text as is.
  @source http://stackoverflow.com/a/20392392/371699
  @param text