diff --git a/include/redfish_v1.hpp b/include/redfish_v1.hpp
index 99e0b3c..57ac7ea 100644
--- a/include/redfish_v1.hpp
+++ b/include/redfish_v1.hpp
@@ -139,59 +139,6 @@
                {{"@odata.id", "/redfish/v1/AccountService/Roles/NoAccess"}}}}}};
         res.end();
       });
-
-  CROW_ROUTE(app, "/redfish/v1/Managers/")
-      .methods("GET"_method)(
-          [&](const crow::request& req, crow::response& res) {
-            res.json_value = {
-                {"@odata.context",
-                 "/redfish/v1/$metadata#ManagerCollection.ManagerCollection"},
-                {"@odata.id", "/redfish/v1/Managers"},
-                {"@odata.type", "#ManagerCollection.ManagerCollection"},
-                {"Name", "Manager Collection"},
-                {"Members@odata.count", 1},
-                {"Members", {{{"@odata.id", "/redfish/v1/Managers/openbmc"}}}}};
-            res.end();
-          });
-
-  CROW_ROUTE(app, "/redfish/v1/Managers/openbmc/")
-      .methods(
-          "GET"_method)([&](const crow::request& req, crow::response& res) {
-        time_t t = time(NULL);
-        tm* mytime = std::localtime(&t);
-        if (mytime == nullptr) {
-          res.code = 500;
-          res.end();
-          return;
-        }
-        std::array<char, 100> time_buffer;
-        std::size_t len = std::strftime(time_buffer.data(), time_buffer.size(),
-                                        "%FT%TZ", mytime);
-        if (len == 0) {
-          res.code = 500;
-          res.end();
-          return;
-        }
-        res.json_value = {
-            {"@odata.context", "/redfish/v1/$metadata#Manager.Manager"},
-            {"@odata.id", "/redfish/v1/Managers/openbmc"},
-            {"@odata.type", "#Manager.v1_3_0.Manager"},
-            {"Id", "openbmc"},
-            {"Name", "OpenBmc Manager"},
-            {"Description", "Baseboard Management Controller"},
-            {"UUID", app.template get_middleware<PersistentData::Middleware>()
-                         .system_uuid},
-            {"Model", "OpenBmc"},  // TODO(ed), get model
-            {"DateTime", time_buffer.data()},
-            {"Status",
-             {{"State", "Enabled"}, {"Health", "OK"}, {"HealthRollup", "OK"}}},
-            {"FirmwareVersion", "1234456789"},  // TODO(ed) get fwversion
-            {"PowerState", "On"}};
-        get_redfish_sub_routes(app, "/redfish/v1/Managers/openbmc/",
-                               res.json_value);
-        res.end();
-      });
-
 }
 }  // namespace redfish
 }  // namespace crow
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index 7714ab7..0c2a912 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -16,6 +16,7 @@
 #pragma once
 
 #include "../lib/account_service.hpp"
+#include "../lib/managers.hpp"
 #include "../lib/network_protocol.hpp"
 #include "../lib/redfish_sessions.hpp"
 #include "../lib/roles.hpp"
@@ -43,6 +44,7 @@
     nodes.emplace_back(std::make_unique<ServiceRoot>(app));
     nodes.emplace_back(std::make_unique<NetworkProtocol>(app));
     nodes.emplace_back(std::make_unique<SessionService>(app));
+    nodes.emplace_back(std::make_unique<ManagerCollection>(app));
 
     for (auto& node : nodes) {
       node->getSubRoutes(nodes);
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
new file mode 100644
index 0000000..0a56da7
--- /dev/null
+++ b/redfish-core/lib/managers.hpp
@@ -0,0 +1,109 @@
+/*
+// Copyright (c) 2018 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+#pragma once
+
+#include "node.hpp"
+
+namespace redfish {
+
+static OperationMap managerOpMap = {
+    {crow::HTTPMethod::GET, {{"Login"}}},
+    {crow::HTTPMethod::HEAD, {{"Login"}}},
+    {crow::HTTPMethod::PATCH, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::PUT, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::DELETE, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::POST, {{"ConfigureManager"}}}};
+
+static OperationMap managerCollectionOpMap = {
+    {crow::HTTPMethod::GET, {{"Login"}}},
+    {crow::HTTPMethod::HEAD, {{"Login"}}},
+    {crow::HTTPMethod::PATCH, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::PUT, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::DELETE, {{"ConfigureManager"}}},
+    {crow::HTTPMethod::POST, {{"ConfigureManager"}}}};
+
+class Manager : public Node {
+ public:
+  Manager(CrowApp& app)
+      : Node(app, EntityPrivileges(std::move(managerOpMap)),
+             "/redfish/v1/Managers/openbmc/") {
+    Node::json["@odata.id"] = "/redfish/v1/Managers/openbmc";
+    Node::json["@odata.type"] = "#Manager.v1_3_0.Manager";
+    Node::json["@odata.context"] = "/redfish/v1/$metadata#Manager.Manager";
+    Node::json["Id"] = "openbmc";
+    Node::json["Name"] = "OpenBmc Manager";
+    Node::json["Description"] = "Baseboard Management Controller";
+    Node::json["PowerState"] = "On";
+    Node::json["Status"]["Health"] = "OK";
+    Node::json["Status"]["HealthRollup"] = "OK";
+    Node::json["Status"]["State"] = "Enabled";
+    Node::json["UUID"] =
+        app.template get_middleware<crow::PersistentData::Middleware>()
+            .system_uuid;
+    Node::json["Model"] = "OpenBmc";               // TODO(ed), get model
+    Node::json["FirmwareVersion"] = "1234456789";  // TODO(ed), get fwversion
+  }
+
+ private:
+  void doGet(crow::response& res, const crow::request& req,
+             const std::vector<std::string>& params) override {
+    Node::json["DateTime"] = getDateTime();
+    res.json_value = Node::json;
+    res.end();
+  }
+
+  std::string getDateTime() const {
+    std::array<char, 128> dateTime;
+    std::string redfishDateTime("0000-00-00T00:00:00Z00:00");
+    std::time_t time = std::time(nullptr);
+
+    if (std::strftime(dateTime.begin(), dateTime.size(), "%FT%T%z",
+                      std::localtime(&time))) {
+      // insert the colon required by the ISO 8601 standard
+      redfishDateTime = std::string(dateTime.data());
+      redfishDateTime.insert(redfishDateTime.end() - 2, ':');
+    }
+
+    return redfishDateTime;
+  }
+};
+
+class ManagerCollection : public Node {
+ public:
+  ManagerCollection(CrowApp& app)
+      : Node(app, EntityPrivileges(std::move(managerCollectionOpMap)),
+             "/redfish/v1/Managers/"),
+        memberManager(app) {
+    Node::json["@odata.id"] = "/redfish/v1/Managers";
+    Node::json["@odata.type"] = "#ManagerCollection.ManagerCollection";
+    Node::json["@odata.context"] =
+        "/redfish/v1/$metadata#ManagerCollection.ManagerCollection";
+    Node::json["Name"] = "Manager Collection";
+    Node::json["Members@odata.count"] = 1;
+    Node::json["Members"] = {{"@odata.id", "/redfish/v1/Managers/openbmc"}};
+  }
+
+ private:
+  void doGet(crow::response& res, const crow::request& req,
+             const std::vector<std::string>& params) override {
+    res.json_value = Node::json;
+    res.end();
+  }
+
+  Manager memberManager;
+};
+
+}  // namespace redfish
