   index: ->
     console.log "loading index route"
     @cleanupViews()
-
-    if (location.search.length < 1)
-      @navigate "sensors?api_key=#{@apiKey}", { replace: true }
+    @addApiKeyParam()
 
     sensors = new Workbench.Collections.SensorsCollection
       source: Workbench.source

    @listenTo Workbench.Events, "redirectToSensor", (sensor) =>
      @navigate "sensors/#{sensor.id}", { trigger: true }

  cleanupViews: ->
    if @indexView
      @indexView.remove()

      @showView.remove()
      delete @showView

  # Check params for API Key. Use the demo user's key if none is specified.
  getApiKey: ->
    if (location.search.length < 1)
      # Demo user read-only key
