code: function logIn(config, location, options) {
      return Q.Promise(function (resolve, reject) {
        if (isLoggedIn) {
          setLocation(location, options).then(resolve);
          return;
        }
        api.init(config.username, config.password, locWrap(location), config.provider, function (err) {
          if (err) {
            return reject(err);
          }
          isLoggedIn = true;
          resolve();
        });
      });
    }
docs: / / API INTERACTION /