     (m "div" nil ["Count: " count " " (page start - count) " " (page start + count)])))
 
 (defn ctrl []
-  (println "Calling major Tom")
-  (fetch "/data.json"))
+  (if (not (:data db nil))
+    (do (println "Calling major Tom")
+        (fetch "/data.json"))))
 
 (defn viewer [c]
   (m "div" nil
      [(m "h1" {:style {:color "green"}} (:var db))
-      (editor {})
+      (editor (:editing db))
       (m "div" {} [(m "ol" nil (notes (:data db) (:start db)))])
       (pages)]))
 

(defn setpage [next]
  (updatedb [:start] next))

;
; View
;

(defn text [value]
  (m "input[type=text]" {:value value} nil))

(defn editor [data]
  (let [title (get data "title" "")

            (m "td" nil "Comment")
            (m "td" nil "Time")
            (m "td" nil "")])
        (m "tr" nil [(m "td" nil (text "title" title))
                     (m "td" nil (text "url" url))
                     (m "td" nil (text "referer" referer))
                     (m "td" nil (text "comment" comment))
                     (m "td" nil (text "time" time))
                     (m "td#edit" nil [(m "button" {:onclick #(save)} "Save")
                                  (m "button" {:onclick #(clear)} "Clear")])])])))

(defn notes [data start]
  "Returns 10 items from data"
