docs: function webhooksSubscribe(app, apimanager, operation, cb) {
    logger.debug('webhooksSubscribe entry');
  
    var whMethod, whTitle, whVerb, whStatusCode, whLogLevel;
    switch (operation) {
      case WH_SUBSCRIBE:
        whMethod = 'POST';
        whTitle = 'This is a webhook subscription for the a catalog, subscribing to all available events specifically';
        whVerb = 'subscribe';
        whStatusCode = 201;
        whLogLevel = 'error';
        break;
      case WH_UNSUBSCRIBE:
        whMethod = 'DELETE';
        whTitle = 'This is a webhook unsubscribe for the a catalog, unsubscribing to all available events specifically';
        whVerb = 'unsubscribe';
        whStatusCode = 204;
        whLogLevel = 'info';
        break;
      default:
        cb(new Error('Internal error during webhooks subscribe/unsubscribe'));
        return;
    }
  
    async.series([
      function(callback) {
  
        var endpointurlObj = {
          protocol: 'http',
          hostname: ip.address(),
          port: process.env.DATASTORE_PORT,
          pathname: '/api/webhooks',
        };
        var endpointurl = url.format(endpointurlObj);
        var body = {
          enabled: 'true',
          endpoint: endpointurl,
          secret: 'notused',
          subscriptions: [
            'catalog',
          ],
          title: whTitle,
        };
  
        var headers = {
          'content-type': 'application/json',
          'x-ibm-client-id': apimanager.clientid,
          accept: 'application/json',
        };
  
        if (logger.debug()) {
          logger.debug(JSON.stringify(headers, null, 2));
        }
  
        var webhooksSubUrlObj = {
          protocol: 'https',
          hostname: apimanager.host,
          port: apimanager.port,
          pathname: '/v1/catalogs/' + apimanager.catalog + '/webhooks',
          search: 'type=strong-gateway',
        };
        var webhooksSubUrl = url.format(webhooksSubUrlObj);
  
        Request({
          url: webhooksSubUrl,
          method: whMethod,
          json: body,
          headers: headers,
          agentOptions: {
            rejectUnauthorized: false, //FIXME: need to eventually remove this
          },
        },
        function(err, res, body) {
          if (err) {
            logger.error('Failed to communicate with %s: %s ', webhooksSubUrl, err);
            return callback(err);
          }
  
          logger.debug('statusCode: ' + res.statusCode);
          if (res.statusCode !== whStatusCode) {
            logger[whLogLevel](webhooksSubUrl, ' failed with: ', res.statusCode);
            currentWebhook = undefined;
            return callback(new Error(webhooksSubUrl + ' failed with: ' + res.statusCode));
          } else if (operation === WH_SUBSCRIBE) {
            logger.debug('Webhooks subscribe received response %d from API Connect server, id %s',
                         res.statusCode, body.id);
            currentWebhook = body.id;
          } else if (operation === WH_UNSUBSCRIBE) {
            logger.debug('Webhooks unsubscribe received response %d from API Connect server',
                         res.statusCode);
            currentWebhook = undefined;
          }
  
          callback(null);
        });
      } ],
      function(err) {
        if (err) {
          apimanager.webhooksOk = false;
          logger[whLogLevel]('Unsuccessful webhooks ' + whVerb + ' with API Connect server');
        } else {
          apimanager.webhooksOk = true;
          logger.info('Successful webhooks ' + whVerb + ' with API Connect server');
        }
        logger.debug('webhooksSubscribe exit');
        cb(err);
      });
  }