 
 (defn render-page
   "Retrieve a page from the datastore and render it for display to the user"
-  [title]
+  [url]
   (try
-    (response-wrapper title (:body (ds/retrieve Page title)))
+    (response-wrapper url (:body (ds/retrieve Page url)))
     (catch EntityNotFoundException _
-      (response-wrapper "404" (str "Unable to find page: " title) 404))))
+      (response-wrapper "404" (str "Unable to find page: " url) 404))))
 
 (defn add-or-edit-form
   "Returns a form to add or edit a page."

              (label "body" "Body:") [:br]
              (text-area {:cols 80 :rows 40} "body" body) [:br]
              (submit-button "Submit"))))
                                 
(defn admin-add-page
  "Displays the Ackbar Admin 'Add Page' Page"
  []

                              (edit-link page) (delete-link page)])])))

(defn delete-page
  "Deletes the specified page by url"
  [url]
  (try
    (do (ds/delete! (ds/retrieve Page url))
        (response-wrapper "Deleted"
                          (str "Page deleted: " url)))
    
    (catch EntityNotFoundException _
      (response-wrapper "404" (str "Unable to find page: " url) 404))))

(defn admin-edit-page
  "Displays the Ackbar Admin 'Edit Page' Page"
  [url]
  (try
    (def page (ds/retrieve Page url))
    (response-wrapper "Edit Page"
                      (add-or-edit-form "/admin/edit"
                                        (:title page)
                                        (:body page)))
    (catch EntityNotFoundException _
      (response-wrapper "404" (str "Unable to find page: " url) 404))))

(defn edit-page
  "Edits a page, updating its title and content"
  [url title body]
  (if (ds/exists? Page url)
    (ds/delete! (ds/retrieve Page url)))
  (ds/save! (Page. url title body (System/currentTimeMillis)))
  (result "Page updated!"))

(defn all-pages
