code: function reqres(res, req) {
      if (req && req._headers) {
          throw new Error('Received response object where request object was expected');
      }
      this.res = res;
      this.req = req;
      if (res) {
          if (res.$ && res.$.data) {
              this.data = res.$.data;
          }
          else {
              this.data = { error: null };
              if (!res.$) {
                  res.$ = this;
              }
          }
      }
  }
docs: inbound request response processor returns function that appends output that also has a tun of helper methods