code: def _api(fn):
          
          @_functools.wraps(fn)
          def _fn(self, *args, **kwargs):
              self._throttle_wait()
              if not self._SID:
                  raise RuntimeError('Session closed. Invoke connect() before.')
              return fn(self, *args, **kwargs)
          return _fn
docs: API decorator for common tests (sessions open, etc.) and throttle
          limitation (calls per second).