diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
index 970d767..df561ed 100644
--- a/redfish-core/include/registries/openbmc_message_registry.hpp
+++ b/redfish-core/include/registries/openbmc_message_registry.hpp
@@ -846,7 +846,7 @@
             .resolution = "None.",
         }},
     MessageEntry{
-        "PCIeFatalReceivedERR_NONFATALMessage",
+        "PCIeFatalReceivedErrNonFatalMessage",
         {
             .description =
                 "Indicates a PCIe Received ERR_NONFATAL Message Error.",
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index 31412f3..ef443af 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -46,28 +46,24 @@
     void doGet(crow::Response &res, const crow::Request &req,
                const std::vector<std::string> &params) override
     {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Collections don't include the static data added by SubRoute because
         // it has a duplicate entry for members
-        asyncResp->res.jsonValue["@odata.type"] =
-            "#MessageRegistryFileCollection.MessageRegistryFileCollection";
-        asyncResp->res.jsonValue["@odata.context"] =
-            "/redfish/v1/"
-            "$metadata#MessageRegistryFileCollection."
-            "MessageRegistryFileCollection";
-        asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Registries";
-        asyncResp->res.jsonValue["Name"] = "MessageRegistryFile Collection";
-        asyncResp->res.jsonValue["Description"] =
-            "Collection of MessageRegistryFiles";
-        nlohmann::json &messageRegistryFileArray =
-            asyncResp->res.jsonValue["Members"];
-        messageRegistryFileArray = nlohmann::json::array();
-        messageRegistryFileArray.push_back(
-            {{"@odata.id", "/redfish/v1/Registries/Base"}});
-        messageRegistryFileArray.push_back(
-            {{"@odata.id", "/redfish/v1/Registries/OpenBMC"}});
-        asyncResp->res.jsonValue["Members@odata.count"] =
-            messageRegistryFileArray.size();
+
+        res.jsonValue = {
+            {"@odata.type",
+             "#MessageRegistryFileCollection.MessageRegistryFileCollection"},
+            {"@odata.context", "/redfish/v1/"
+                               "$metadata#MessageRegistryFileCollection."
+                               "MessageRegistryFileCollection"},
+            {"@odata.id", "/redfish/v1/Registries"},
+            {"Name", "MessageRegistryFile Collection"},
+            {"Description", "Collection of MessageRegistryFiles"},
+            {"Members@odata.count", 2},
+            {"Members",
+             {{{"@odata.id", "/redfish/v1/Registries/Base"}},
+              {{"@odata.id", "/redfish/v1/Registries/OpenBMC"}}}}};
+
+        res.end();
     }
 };
 
@@ -91,36 +87,24 @@
     void doGet(crow::Response &res, const crow::Request &req,
                const std::vector<std::string> &params) override
     {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
-
-        asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Registries/Base";
-        asyncResp->res.jsonValue["@odata.type"] =
-            "#MessageRegistryFile.v1_1_0.MessageRegistryFile";
-        asyncResp->res.jsonValue["@odata.context"] =
-            "/redfish/v1/$metadata#MessageRegistryFile.MessageRegistryFile";
-        asyncResp->res.jsonValue["Name"] = "Base Message Registry File";
-        asyncResp->res.jsonValue["Description"] =
-            "DMTF Base Message Registry File Location";
-        asyncResp->res.jsonValue["Id"] =
-            message_registries::base::header.registryPrefix;
-        asyncResp->res.jsonValue["Registry"] =
-            message_registries::base::header.id;
-        nlohmann::json &messageRegistryLanguageArray =
-            asyncResp->res.jsonValue["Languages"];
-        messageRegistryLanguageArray = nlohmann::json::array();
-        messageRegistryLanguageArray.push_back({"en"});
-        asyncResp->res.jsonValue["Languages@odata.count"] =
-            messageRegistryLanguageArray.size();
-        nlohmann::json &messageRegistryLocationArray =
-            asyncResp->res.jsonValue["Location"];
-        messageRegistryLocationArray = nlohmann::json::array();
-        messageRegistryLocationArray.push_back(
-            {{"Language", "en"},
-             {"PublicationUri",
-              "https://redfish.dmtf.org/registries/Base.1.4.0.json"},
-             {"Uri", "/redfish/v1/Registries/Base/Base"}});
-        asyncResp->res.jsonValue["Location@odata.count"] =
-            messageRegistryLocationArray.size();
+        res.jsonValue = {
+            {"@odata.id", "/redfish/v1/Registries/Base"},
+            {"@odata.type", "#MessageRegistryFile.v1_1_0.MessageRegistryFile"},
+            {"@odata.context",
+             "/redfish/v1/$metadata#MessageRegistryFile.MessageRegistryFile"},
+            {"Name", "Base Message Registry File"},
+            {"Description", "DMTF Base Message Registry File Location"},
+            {"Id", message_registries::base::header.registryPrefix},
+            {"Registry", message_registries::base::header.id},
+            {"Languages", {"en"}},
+            {"Languages@odata.count", 1},
+            {"Location",
+             {{{"Language", "en"},
+               {"PublicationUri",
+                "https://redfish.dmtf.org/registries/Base.1.4.0.json"},
+               {"Uri", "/redfish/v1/Registries/Base/Base"}}}},
+            {"Location@odata.count", 1}};
+        res.end();
     }
 };
 
@@ -144,43 +128,33 @@
     void doGet(crow::Response &res, const crow::Request &req,
                const std::vector<std::string> &params) override
     {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
+        res.jsonValue = {
+            {"@Redfish.Copyright", message_registries::base::header.copyright},
+            {"@odata.type", message_registries::base::header.type},
+            {"Id", message_registries::base::header.id},
+            {"Name", message_registries::base::header.name},
+            {"Language", message_registries::base::header.language},
+            {"Description", message_registries::base::header.description},
+            {"RegistryPrefix", message_registries::base::header.registryPrefix},
+            {"RegistryVersion",
+             message_registries::base::header.registryVersion},
+            {"OwningEntity", message_registries::base::header.owningEntity}};
 
-        asyncResp->res.jsonValue["@Redfish.Copyright"] =
-            message_registries::base::header.copyright;
-        asyncResp->res.jsonValue["@odata.type"] =
-            message_registries::base::header.type;
-        asyncResp->res.jsonValue["Id"] = message_registries::base::header.id;
-        asyncResp->res.jsonValue["Name"] =
-            message_registries::base::header.name;
-        asyncResp->res.jsonValue["Language"] =
-            message_registries::base::header.language;
-        asyncResp->res.jsonValue["Description"] =
-            message_registries::base::header.description;
-        asyncResp->res.jsonValue["RegistryPrefix"] =
-            message_registries::base::header.registryPrefix;
-        asyncResp->res.jsonValue["RegistryVersion"] =
-            message_registries::base::header.registryVersion;
-        asyncResp->res.jsonValue["OwningEntity"] =
-            message_registries::base::header.owningEntity;
-        nlohmann::json &messageArray = asyncResp->res.jsonValue["Messages"];
-        messageArray = nlohmann::json::array();
+        nlohmann::json &messageObj = res.jsonValue["Messages"];
 
         // Go through the Message Registry and populate each Message
         for (const message_registries::MessageEntry &message :
              message_registries::base::registry)
         {
-            messageArray.push_back(
-                {{message.first,
-                  {{"Description", message.second.description},
+            nlohmann::json &obj = messageObj[message.first];
+            obj = {{"Description", message.second.description},
                    {"Message", message.second.message},
                    {"Severity", message.second.severity},
                    {"NumberOfArgs", message.second.numberOfArgs},
-                   {"Resolution", message.second.resolution}}}});
+                   {"Resolution", message.second.resolution}};
             if (message.second.numberOfArgs > 0)
             {
-                nlohmann::json &messageParamArray =
-                    messageArray.back()[message.first]["ParamTypes"];
+                nlohmann::json &messageParamArray = obj["ParamTypes"];
                 for (const char *str : message.second.paramTypes)
                 {
                     if (str == nullptr)
@@ -191,6 +165,7 @@
                 }
             }
         }
+        res.end();
     }
 };
 
@@ -214,35 +189,23 @@
     void doGet(crow::Response &res, const crow::Request &req,
                const std::vector<std::string> &params) override
     {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
+        res.jsonValue = {
+            {"@odata.id", "/redfish/v1/Registries/OpenBMC"},
+            {"@odata.type", "#MessageRegistryFile.v1_1_0.MessageRegistryFile"},
+            {"@odata.context",
+             "/redfish/v1/$metadata#MessageRegistryFile.MessageRegistryFile"},
+            {"Name", "Open BMC Message Registry File"},
+            {"Description", "Open BMC Message Registry File Location"},
+            {"Id", message_registries::openbmc::header.registryPrefix},
+            {"Registry", message_registries::openbmc::header.id},
+            {"Languages", {"en"}},
+            {"Languages@odata.count", 1},
+            {"Location",
+             {{{"Language", "en"},
+               {"Uri", "/redfish/v1/Registries/OpenBMC/OpenBMC"}}}},
+            {"Location@odata.count", 1}};
 
-        asyncResp->res.jsonValue["@odata.id"] =
-            "/redfish/v1/Registries/OpenBMC";
-        asyncResp->res.jsonValue["@odata.type"] =
-            "#MessageRegistryFile.v1_1_0.MessageRegistryFile";
-        asyncResp->res.jsonValue["@odata.context"] =
-            "/redfish/v1/$metadata#MessageRegistryFile.MessageRegistryFile";
-        asyncResp->res.jsonValue["Name"] = "Open BMC Message Registry File";
-        asyncResp->res.jsonValue["Description"] =
-            "Open BMC Message Registry File Location";
-        asyncResp->res.jsonValue["Id"] =
-            message_registries::openbmc::header.registryPrefix;
-        asyncResp->res.jsonValue["Registry"] =
-            message_registries::openbmc::header.id;
-        nlohmann::json &messageRegistryLanguageArray =
-            asyncResp->res.jsonValue["Languages"];
-        messageRegistryLanguageArray = nlohmann::json::array();
-        messageRegistryLanguageArray.push_back({"en"});
-        asyncResp->res.jsonValue["Languages@odata.count"] =
-            messageRegistryLanguageArray.size();
-        nlohmann::json &messageRegistryLocationArray =
-            asyncResp->res.jsonValue["Location"];
-        messageRegistryLocationArray = nlohmann::json::array();
-        messageRegistryLocationArray.push_back(
-            {{"Language", "en"},
-             {"Uri", "/redfish/v1/Registries/OpenBMC/OpenBMC"}});
-        asyncResp->res.jsonValue["Location@odata.count"] =
-            messageRegistryLocationArray.size();
+        res.end();
     }
 };
 
@@ -266,49 +229,41 @@
     void doGet(crow::Response &res, const crow::Request &req,
                const std::vector<std::string> &params) override
     {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
+        res.jsonValue = {
+            {"@Redfish.Copyright",
+             message_registries::openbmc::header.copyright},
+            {"@odata.type", message_registries::openbmc::header.type},
+            {"Id", message_registries::openbmc::header.id},
+            {"Name", message_registries::openbmc::header.name},
+            {"Language", message_registries::openbmc::header.language},
+            {"Description", message_registries::openbmc::header.description},
+            {"RegistryPrefix",
+             message_registries::openbmc::header.registryPrefix},
+            {"RegistryVersion",
+             message_registries::openbmc::header.registryVersion},
+            {"OwningEntity", message_registries::openbmc::header.owningEntity}};
 
-        asyncResp->res.jsonValue["@Redfish.Copyright"] =
-            message_registries::openbmc::header.copyright;
-        asyncResp->res.jsonValue["@odata.type"] =
-            message_registries::openbmc::header.type;
-        asyncResp->res.jsonValue["Id"] = message_registries::openbmc::header.id;
-        asyncResp->res.jsonValue["Name"] =
-            message_registries::openbmc::header.name;
-        asyncResp->res.jsonValue["Language"] =
-            message_registries::openbmc::header.language;
-        asyncResp->res.jsonValue["Description"] =
-            message_registries::openbmc::header.description;
-        asyncResp->res.jsonValue["RegistryPrefix"] =
-            message_registries::openbmc::header.registryPrefix;
-        asyncResp->res.jsonValue["RegistryVersion"] =
-            message_registries::openbmc::header.registryVersion;
-        asyncResp->res.jsonValue["OwningEntity"] =
-            message_registries::openbmc::header.owningEntity;
-        nlohmann::json &messageArray = asyncResp->res.jsonValue["Messages"];
-        messageArray = nlohmann::json::array();
-
+        nlohmann::json &messageObj = res.jsonValue["Messages"];
         // Go through the Message Registry and populate each Message
         for (const message_registries::MessageEntry &message :
              message_registries::openbmc::registry)
         {
-            messageArray.push_back(
-                {{message.first,
-                  {{"Description", message.second.description},
+            nlohmann::json &obj = messageObj[message.first];
+            obj = {{"Description", message.second.description},
                    {"Message", message.second.message},
                    {"Severity", message.second.severity},
                    {"NumberOfArgs", message.second.numberOfArgs},
-                   {"Resolution", message.second.resolution}}}});
+                   {"Resolution", message.second.resolution}};
             if (message.second.numberOfArgs > 0)
             {
-                nlohmann::json &messageParamArray =
-                    messageArray.back()[message.first]["ParamTypes"];
+                nlohmann::json &messageParamArray = obj["ParamTypes"];
                 for (int i = 0; i < message.second.numberOfArgs; i++)
                 {
                     messageParamArray.push_back(message.second.paramTypes[i]);
                 }
             }
         }
+        res.end();
     }
 };
 
