lib/sapi.js
function Sapi(key, opts) {
  opts = opts || {};

  function _authRequire(result, cb) {
    // SAPI does not differentiate required authentication and failed authentication
    // since both return status code 403, need to check key param existence to differentiate the two
    if (key) {
      cb(new Error('Authentication failed -  invalid key ' + key));
    } else {
      cb(new Error('Authentication required - set API key in Sapi constructor'));
    }
  }

  this.params = { key: key };
  this.url = (opts.url || 'http://api.sensis.com.au/ob-20110511/test').replace(/\/$/, '');
  this.opts = {
    handlers: {
      403: _authRequire
    }
  };
}
function Sapi(key, opts) {
  opts = opts || {};

  function _authRequire(result, cb) {
    // SAPI does not differentiate required authentication and failed authentication
    // since both return status code 403, need to check key param existence to differentiate the two
    if (key) {
      cb(new Error('Authentication failed -  invalid key ' + key));
    } else {
      cb(new Error('Authentication required - set API key in Sapi constructor'));
    }
  }

  this.params = { key: key };
  this.url = (opts.url || 'http://api.sensis.com.au/ob-20110511/test').replace(/\/$/, '');
  this.opts = {
    handlers: {
      403: _authRequire
    }
  };
}
class Sapi

@param {String} key: Sensis API key, apply for the key here http://developers.sensis.com.au/docs/getting_started/Apply_for_an_API_key
@param {Object} opts: optional
- url: optional Sensis API base URL, defaults to http://developers.sensis.com.au/docs/using_endpoints