 ;; END TEST CODE
 
   ; Blog
+  (GET "/blog/" {session :session} (redirect-with-session "/blog" session))
   (GET "/blog"
-    {session :session, params :params}
+    {session :session, params :params, uri :uri}
     (let [session-info (cbauth/make-session-info session)]
       {:body (cbblog/get-posts session-info 0 cbsettings/posts-per-page)
         :session session}))
 
+  (GET "/blog/archive/" {session :session} (redirect-with-session "/blog/archive" session))
   (GET "/blog/archive" 
-    {session :session, params :params}
+    {session :session, params :params, uri :uri}
+    ; TODO
     "hullo")
 
+  (GET ["/blog/:start/:count/" :start #"[0-9]+" :count #"[0-9]+"] {session :session, params :params}
+    (redirect-with-session 
+      (apply str ["/blog/" (:start params) "/" (:count params)])
+      session))
   (GET ["/blog/:start/:count" :start #"[0-9]+" :count #"[0-9]+"]
-    {session :session, params :params}
+    {session :session, params :params, uri :uri}
     (let [session-info (cbauth/make-session-info session)]
       {:body (cbblog/get-posts session-info (:start params 0) (:count params 10))
         :session session}))
 
+  (GET ["/post/:id/" :id #"[0-9]+"] {session :session, params :params}
+    (redirect-with-session (apply str ["/post/" (:id params)]) session))
   (GET ["/post/:id" :id #"[0-9]+"]
-    {session :session, params :params}
+    {session :session, params :params, uri :uri}
     (let [session-info (cbauth/make-session-info session)]
       {:body (cbblog/get-post session-info (:id params nil))
         :session session}))
 
   ; Admin panel
   (POST "/admin/login"
-    {session :session, params :params}
+    {session :session, params :params, uri :uri}
     (if (cbauth/credentials-valid? params)
       ;; TODO: Redirect to the previous page.
       (assoc (response/redirect "/") :session (cbauth/add-admin-session session))

        (response-403 session "You must first log in to compose new posts." nil nil))))

  (GET ["/admin/delete/post/:id" :id #"[0-9]+"]
    {session :session, params :params} 
    (if (cbauth/admin? session) 
      {:body (cbblog/post-delete! session params)
        :session session} 
      (response-403 session "You must first log in to delete posts." nil nil)))

  (POST "/admin/submit/post"
    {session :session, params :params}
    (if (cbauth/admin? session) 
      {:body (cbblog/post-npsubmit! session params)
        :session session}

      "Invalid credentials, try again"))

  (GET "/admin/logout" 
    {session :session, params :params, uri :uri}
    (if (cbauth/admin? session)
      ; TODO: Fix this
      {:body "Logged out", 
