 
 (defn any-misses? [rel]
   {:pre [(some #{rel} '("master" "apprentice"))]}
-  (let [loaded-sith-lords (filter some? (map :sith-lord @items))]
+  (let [loaded-sith-lords (filter some? (map :data @items))]
     (not (empty? (filter nil? (map #(get-in % [rel "id"]) loaded-sith-lords))))))
 
 (defn sith-lords []
-  (map :sith-lord @items))
+  (map :data @items))
 
 (defn- assoc-pending-sith-lord [items index id]
   (if (and (>= index 0) (< index (count items)) (nil? (get-in items [index :id])))


(defn- start-request! [item]
  (if-let [id (:id item)]
    (if (not (some item '(:sith-lord :request)))
      (let [url (str "http://localhost:3000/dark-jedis/" id)
            request (ajax/GET url :response-format :json :handler handle-sith-lord-response!)]
        (assoc item :request request))


(defn- scroll-once! [items direction]
  (case direction
    :up (let [first-sith-lord (-> items first :data)
              master-id (get-in first-sith-lord ["master" "id"])
              master-item {:id master-id}]
          (abort-request! (peek items))
          (into [master-item] (pop items)))
    :down (let [last-sith-lord (-> items last :data)
                apprentice-id (get-in last-sith-lord ["apprentice" "id"])
                apprentice-item {:id apprentice-id}]
            (abort-request! (nth items 0))
