 
       # `exec` handles the execution of the command.
       exec: (cmd, args, callback) ->
-        get command_name, null, (data) ->
-          return err("api request failed to get data")  unless data
-          template = _self.shell.templates[command_name]
-          template = template or _self.shell.templates.default_template
-          template_args = {}
-          template_args[command_name] = template_args["data"] = data
-          _console.debug "[Josh.FeedlyConsole] data %O cmd %O args %O",
-          data, cmd, args
-          callback template(template_args)
+        if _self.api
+          _self.api.get command_name, null, (data) ->
+            return err("api request failed to get data")  unless data
+            template = _self.shell.templates[command_name]
+            template = template or _self.shell.templates.default_template
+            template_args = {}
+            template_args[command_name] = template_args["data"] = data
+            _console.debug "[Josh.FeedlyConsole] data %O cmd %O args %O",
+            data, cmd, args
+            callback template(template_args)
+        else
+          callback _self.shell.templates.not_ready({cmd})
 
 
     simple_commands = [

      chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->
        _console.debug "[feedlyconsole] msg: %s.", request.msg
        if request.action is "icon_active"
          url_array = request.url.split("/")
          url = url_array[0] + "//" + url_array[2] + "/" + _self.api_version
          _console.debug "[feedlyconsole] set api url: %s.", url
          _self.api = url
        else if request.action is "toggle_console"
          unless _self.ui.toggleActivateAndShow?
            window.console.warn "[feedlyconsole] ui not yet ready"
          else
            _self.ui.toggleActivateAndShow()
        else if request.action is "cookie_feedlytoken"
          _self.OAuth = request.feedlytoken
          _console.debug "[feedlyconsole] token %s...", _self.OAuth.slice(0, 8)
        else
          _console.debug "[feedlyconsole] unknown action %s request %O.",
          request.action, request


    # });
    insertCSSLink = (name) ->
      console.debug "[feedlyconsole] inserting css #{name}"
      # insert css into head
      $("head").append $ "<link/>",
        rel: "stylesheet"
