         let router = drop.grouped("admin")
         let routerSecure = router.grouped(protect)
         
-        router.get("login", handler: login)
-        router.post("login", handler: loginAction)
+        router.get("login", handler: loginView)
+        router.post("login", handler: login)
         routerSecure.get("", handler: index)
-        routerSecure.get("write-post", handler: writePost)
-        routerSecure.post("write-post", handler: writePost_)
-        routerSecure.get("posts", handler: posts)
+        routerSecure.get("write-post", handler: writePostView)
+        routerSecure.post("write-post", handler: writePost)
+        routerSecure.get("posts", handler: postsView)
         routerSecure.get("logout", handler: logout)
     }
 

        return try drop.view.make("/admin/write-post.leaf")
    }

    func posts(_ request: Request) throws -> ResponseRepresentable {
        let posts = try Post.all().makeNode()
        return try drop.view.make("admin/posts.leaf", ["posts":posts])
    }

        }
    }

    func writePostView(_ request: Request) throws -> ResponseRepresentable {
        return try drop.view.make("/admin/write-post.leaf")
    }

    func writePost(_ request: Request) throws -> ResponseRepresentable {
        if let title = request.data["title"]?.string, let text = request.data["text"]?.string {
            var post = Post(title: title, text:text)
            do {
