code: function updateSession(callback) {
    core.api({method: ''}, function(err, response) {
      var session;
      if (err) {
        core.log('error encountered updating session:', err);
        callback && callback(err, null);
        return;
      }
  
      if (!response.token.valid) {
        // Invalid token. Either it has expired or the user has
        // revoked permission, so clear out our stored data.
        logout(callback);
        return;
      }
  
      callback && callback(null, session);
    });
  }
docs: Updates session info from the API.
  
  @private @method updateSession