docs: function CouchPotatoAPI(options) {
  
    // gather params
    this.hostname = options.hostname;
    this.port = options.port || 5050;
    this.apiKey = options.apiKey;
    this.urlBase = options.urlBase;
    this.ssl = options.ssl || false;
    this.username = options.username || null;
    this.password = options.password || null;
    this.auth = false;
  
    // http_auth requested
    if (this.username && this.password) {
      this.auth = true;
    }
  
    // hostname in valid
    if (!this.hostname) {
      throw new TypeError('Hostname is empty');
    }
  
    // sanitize hostname
    this.hostname = this.hostname.replace(/^https?:\/\//, '');
  
    // port is valid
    if ((!this.port) || (typeof this.port !== 'number')) {
      try {
        this.port = parseInt(this.port);
      } catch (e) {
        throw new TypeError('Port is not a number');
      }
    }
  
    // api key is valid length
    if (this.apiKey.length !== 32) {
      throw new TypeError('API Key is an invalid length');
    }
  
    // api key has valid characters
    if (this.apiKey.search(/[^a-z0-9]+/g) !== -1) {
      throw new TypeError('API Key has invalid characters');
    }
  
    // url base is valid
    if ((this.urlBase) && (this.urlBase.charAt(0) !== '/')) {
      this.urlBase = '/' + this.urlBase;
    }
  
    // build the url
    var serverUrl = 'http' + (this.ssl !== false ? 's' : '') + '://' + this.hostname + ':' + this.port;
  
    // add in the url base
    if (this.urlBase) {
      serverUrl = serverUrl + this.urlBase;
    }
  
    // complete api url
    this.serverApi = serverUrl + '/api/' + this.apiKey + '/';
  }