code: private ServerResponse processEntityForJSON(String responseString, int statusCode, String tag) {
          ServerResponse result = new ServerResponse(tag, statusCode);
          PrefHelper.Debug("returned " + responseString);
  
          if (responseString != null) {
              try {
                  JSONObject jsonObj = new JSONObject(responseString);
                  result.setPost(jsonObj);
              } catch (JSONException ex) {
                  try {
                      JSONArray jsonArray = new JSONArray(responseString);
                      result.setPost(jsonArray);
                  } catch (JSONException ex2) {
                      PrefHelper.Debug("JSON exception: " + ex2.getMessage());
                  }
              }
          }
          return result;
      }
docs: <p>Converts resultant output object from Branch Remote server into a {@link ServerResponse} object by
  reading the content supplied in the raw server response, and creating a {@link JSONObject}
  that contains the same data. This data is then attached as the post data of the
  {@link ServerResponse} object returned.</p>
  
  @param responseString Branch server response received. A  string form of the input or error stream payload
  @param statusCode     An {@link Integer} value containing the HTTP response code.
  @param tag            A {@link String} value containing the tag value to be applied to the
  resultant {@link ServerResponse} object.
  @return A {@link ServerResponse} object representing the resultant output object from Branch Remote server
  response in Branch SDK terms.
  see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP/1.1: Status Codes</a>