diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index ac8778f..bb38cb8 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -15,10 +15,11 @@
 {
 const std::vector<uint8_t> pdrTypes{PLDM_STATE_SENSOR_PDR};
 
-DbusToPLDMEvent::DbusToPLDMEvent(int mctp_fd, uint8_t mctp_eid,
-                                 Requester& requester) :
+DbusToPLDMEvent::DbusToPLDMEvent(
+    int mctp_fd, uint8_t mctp_eid, Requester& requester,
+    pldm::requester::Handler<pldm::requester::Request>* handler) :
     mctp_fd(mctp_fd),
-    mctp_eid(mctp_eid), requester(requester)
+    mctp_eid(mctp_eid), requester(requester), handler(handler)
 {}
 
 void DbusToPLDMEvent::sendEventMsg(uint8_t eventType,
@@ -42,36 +43,34 @@
         return;
     }
 
-    uint8_t* responseMsg = nullptr;
-    size_t responseMsgSize{};
+    auto platformEventMessageResponseHandler = [](mctp_eid_t /*eid*/,
+                                                  const pldm_msg* response,
+                                                  size_t respMsgLen) {
+        if (response == nullptr || !respMsgLen)
+        {
+            std::cerr
+                << "Failed to receive response for platform event message \n";
+            return;
+        }
+        uint8_t completionCode{};
+        uint8_t status{};
+        auto rc = decode_platform_event_message_resp(response, respMsgLen,
+                                                     &completionCode, &status);
+        if (rc || completionCode)
+        {
+            std::cerr << "Failed to decode_platform_event_message_resp: "
+                      << "rc=" << rc
+                      << ", cc=" << static_cast<unsigned>(completionCode)
+                      << std::endl;
+        }
+    };
 
-    auto requesterRc =
-        pldm_send_recv(mctp_eid, mctp_fd, requestMsg.data(), requestMsg.size(),
-                       &responseMsg, &responseMsgSize);
-    std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{responseMsg,
-                                                                  std::free};
-
-    requester.markFree(mctp_eid, instanceId);
-    if (requesterRc != PLDM_REQUESTER_SUCCESS)
+    rc = handler->registerRequest(
+        mctp_eid, instanceId, PLDM_PLATFORM, PLDM_PLATFORM_EVENT_MESSAGE,
+        std::move(requestMsg), std::move(platformEventMessageResponseHandler));
+    if (rc)
     {
-        std::cerr
-            << "Failed to send msg to report state sensor event changes, rc = "
-            << requesterRc << std::endl;
-        return;
-    }
-    uint8_t completionCode{};
-    uint8_t status{};
-    auto responsePtr = reinterpret_cast<struct pldm_msg*>(responseMsgPtr.get());
-    rc = decode_platform_event_message_resp(
-        responsePtr, responseMsgSize - sizeof(pldm_msg_hdr), &completionCode,
-        &status);
-
-    if (rc != PLDM_SUCCESS || completionCode != PLDM_SUCCESS)
-    {
-        std::cerr << "Failed to decode_platform_event_message_resp: "
-                  << "rc=" << rc
-                  << ", cc=" << static_cast<unsigned>(completionCode)
-                  << std::endl;
+        std::cerr << "Failed to send the platform event message \n";
     }
 }
 
diff --git a/host-bmc/dbus_to_event_handler.hpp b/host-bmc/dbus_to_event_handler.hpp
index add5c2d..2a25243 100644
--- a/host-bmc/dbus_to_event_handler.hpp
+++ b/host-bmc/dbus_to_event_handler.hpp
@@ -4,6 +4,7 @@
 
 #include "libpldmresponder/pdr_utils.hpp"
 #include "pldmd/dbus_impl_requester.hpp"
+#include "requester/handler.hpp"
 
 #include <map>
 
@@ -40,9 +41,11 @@
      *  @param[in] mctp_fd - fd of MCTP communications socket
      *  @param[in] mctp_eid - MCTP EID of host firmware
      *  @param[in] requester - reference to Requester object
+     *  @param[in] handler - PLDM request handler
      */
-    explicit DbusToPLDMEvent(int mctp_fd, uint8_t mctp_eid,
-                             Requester& requester);
+    explicit DbusToPLDMEvent(
+        int mctp_fd, uint8_t mctp_eid, Requester& requester,
+        pldm::requester::Handler<pldm::requester::Request>* handler);
 
   public:
     /** @brief Listen all of the state sensor PDRs
@@ -79,6 +82,9 @@
     /** @brief D-Bus property changed signal match */
     std::vector<std::unique_ptr<sdbusplus::bus::match::match>>
         stateSensorMatchs;
+
+    /** @brief PLDM request handler */
+    pldm::requester::Handler<pldm::requester::Request>* handler;
 };
 
 } // namespace state_sensor
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index 4bdeda5..6dff8af 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -280,42 +280,40 @@
             std::cout << tempStream.str() << std::endl;
         }
     }
+    auto setStateEffecterStatesRespHandler =
+        [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
+            if (response == nullptr || !respMsgLen)
+            {
+                std::cerr << "Failed to receive response for "
+                          << "setStateEffecterStates command \n";
+                return;
+            }
+            uint8_t completionCode{};
+            auto rc = decode_set_state_effecter_states_resp(
+                response, respMsgLen, &completionCode);
+            if (rc)
+            {
+                std::cerr << "Failed to decode setStateEffecterStates response,"
+                          << " rc " << rc << "\n";
+                pldm::utils::reportError(
+                    "xyz.openbmc_project.bmc.pldm.SetHostEffecterFailed");
+            }
+            if (completionCode)
+            {
+                std::cerr << "Failed to set a Host effecter "
+                          << ", cc=" << static_cast<unsigned>(completionCode)
+                          << "\n";
+                pldm::utils::reportError(
+                    "xyz.openbmc_project.bmc.pldm.SetHostEffecterFailed");
+            }
+        };
 
-    uint8_t* responseMsg = nullptr;
-    size_t responseMsgSize{};
-
-    rc = pldm_send_recv(mctpEid, sockFd, requestMsg.data(), requestMsg.size(),
-                        &responseMsg, &responseMsgSize);
-    std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{responseMsg,
-                                                                  std::free};
-    requester->markFree(mctpEid, instanceId);
-
-    if (rc != PLDM_REQUESTER_SUCCESS)
+    rc = handler->registerRequest(
+        mctpEid, instanceId, PLDM_PLATFORM, PLDM_SET_STATE_EFFECTER_STATES,
+        std::move(requestMsg), std::move(setStateEffecterStatesRespHandler));
+    if (rc)
     {
-        std::cerr << "Failed to send message/receive response. RC = " << rc
-                  << ", errno = " << errno << " for setting host effecter "
-                  << effecterId << "\n";
-        pldm::utils::reportError(
-            "xyz.openbmc_project.bmc.pldm.InternalFailure");
-        return rc;
-    }
-    auto responsePtr = reinterpret_cast<struct pldm_msg*>(responseMsgPtr.get());
-    uint8_t completionCode{};
-    rc = decode_set_state_effecter_states_resp(
-        responsePtr, responseMsgSize - sizeof(pldm_msg_hdr), &completionCode);
-    if (rc != PLDM_SUCCESS)
-    {
-        std::cerr << "Failed to decode setStateEffecterStates response, rc = "
-                  << rc << "\n";
-        return rc;
-    }
-    if (completionCode != PLDM_SUCCESS)
-    {
-        std::cerr << "Failed setStateEffecterStates for effecter " << effecterId
-                  << ". Response from Host " << (uint32_t)completionCode
-                  << "\n";
-        pldm::utils::reportError(
-            "xyz.openbmc_project.bmc.pldm.InternalFailure");
+        std::cerr << "Failed to send request to set an effecter on Host \n";
     }
     return rc;
 }
diff --git a/host-bmc/dbus_to_host_effecters.hpp b/host-bmc/dbus_to_host_effecters.hpp
index d024ed6..9c0314d 100644
--- a/host-bmc/dbus_to_host_effecters.hpp
+++ b/host-bmc/dbus_to_host_effecters.hpp
@@ -3,6 +3,7 @@
 #include "common/types.hpp"
 #include "common/utils.hpp"
 #include "pldmd/dbus_impl_requester.hpp"
+#include "requester/handler.hpp"
 
 #include <string>
 #include <utility>
@@ -75,15 +76,17 @@
      *  @param[in] repo -  PLDM PDR repository
      *  @param[in] dbusHandler - D-bus Handler
      *  @param[in] jsonPath - path for the json file
+     *  @param[in] handler - PLDM request handler
      *  @param[in] verbose - verbosity
      */
-    explicit HostEffecterParser(Requester* requester, int fd,
-                                const pldm_pdr* repo,
-                                DBusHandler* const dbusHandler,
-                                const std::string& jsonPath,
-                                bool verbose = false) :
+    explicit HostEffecterParser(
+        Requester* requester, int fd, const pldm_pdr* repo,
+        DBusHandler* const dbusHandler, const std::string& jsonPath,
+        pldm::requester::Handler<pldm::requester::Request>* handler,
+        bool verbose = false) :
         requester(requester),
-        sockFd(fd), pdrRepo(repo), dbusHandler(dbusHandler), verbose(verbose)
+        sockFd(fd), pdrRepo(repo), dbusHandler(dbusHandler), handler(handler),
+        verbose(verbose)
     {
         try
         {
@@ -175,7 +178,9 @@
         effecterInfoMatch; //!< vector to catch the D-Bus property change
                            //!< signals for the effecters
     const DBusHandler* dbusHandler; //!< D-bus Handler
-    bool verbose;                   //!< verbose flag
+    /** @brief PLDM request handler */
+    pldm::requester::Handler<pldm::requester::Request>* handler;
+    bool verbose; //!< verbose flag
 };
 
 } // namespace host_effecters
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 4c5a9a4..f9d30b5 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -25,7 +25,7 @@
     int mctp_fd, uint8_t mctp_eid, sdeventplus::Event& event, pldm_pdr* repo,
     const std::string& eventsJsonsDir, pldm_entity_association_tree* entityTree,
     pldm_entity_association_tree* bmcEntityTree, Requester& requester,
-    pldm::requester::Handler<pldm::requester::Request>& handler, bool verbose) :
+    pldm::requester::Handler<pldm::requester::Request>* handler, bool verbose) :
     mctp_fd(mctp_fd),
     mctp_eid(mctp_eid), event(event), repo(repo),
     stateSensorHandler(eventsJsonsDir), entityTree(entityTree),
@@ -107,151 +107,53 @@
 
 void HostPDRHandler::_fetchPDR(sdeventplus::source::EventBase& /*source*/)
 {
+    getHostPDR();
+}
+
+void HostPDRHandler::getHostPDR(uint32_t nextRecordHandle)
+{
     pdrFetchEvent.reset();
 
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_GET_PDR_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
-    bool merged = false;
-    PDRList stateSensorPDRs{};
-    TLPDRMap tlpdrInfo{};
-
-    uint32_t nextRecordHandle{};
     uint32_t recordHandle{};
-    bool isFormatRecHandles = false;
-    if (!pdrRecordHandles.empty())
+    if (!nextRecordHandle)
     {
-        recordHandle = pdrRecordHandles.front();
-        pdrRecordHandles.pop_front();
-        isFormatRecHandles = true;
+        if (!pdrRecordHandles.empty())
+        {
+            recordHandle = pdrRecordHandles.front();
+            pdrRecordHandles.pop_front();
+        }
+    }
+    else
+    {
+        recordHandle = nextRecordHandle;
+    }
+    auto instanceId = requester.getInstanceId(mctp_eid);
+
+    auto rc =
+        encode_get_pdr_req(instanceId, recordHandle, 0, PLDM_GET_FIRSTPART,
+                           UINT16_MAX, 0, request, PLDM_GET_PDR_REQ_BYTES);
+    if (rc != PLDM_SUCCESS)
+    {
+        requester.markFree(mctp_eid, instanceId);
+        std::cerr << "Failed to encode_get_pdr_req, rc = " << rc << std::endl;
+        return;
+    }
+    if (verbose)
+    {
+        std::cout << "Sending Msg:" << std::endl;
+        printBuffer(requestMsg, verbose);
     }
 
-    do
+    rc = handler->registerRequest(
+        mctp_eid, instanceId, PLDM_PLATFORM, PLDM_GET_PDR,
+        std::move(requestMsg),
+        std::move(std::bind_front(&HostPDRHandler::processHostPDRs, this)));
+    if (rc)
     {
-        auto instanceId = requester.getInstanceId(mctp_eid);
-
-        auto rc =
-            encode_get_pdr_req(instanceId, recordHandle, 0, PLDM_GET_FIRSTPART,
-                               UINT16_MAX, 0, request, PLDM_GET_PDR_REQ_BYTES);
-        if (rc != PLDM_SUCCESS)
-        {
-            requester.markFree(mctp_eid, instanceId);
-            std::cerr << "Failed to encode_get_pdr_req, rc = " << rc
-                      << std::endl;
-            return;
-        }
-        if (verbose)
-        {
-            std::cout << "Sending Msg:" << std::endl;
-            printBuffer(requestMsg, verbose);
-        }
-
-        uint8_t* responseMsg = nullptr;
-        size_t responseMsgSize{};
-        auto requesterRc =
-            pldm_send_recv(mctp_eid, mctp_fd, requestMsg.data(),
-                           requestMsg.size(), &responseMsg, &responseMsgSize);
-        std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{
-            responseMsg, std::free};
-        requester.markFree(mctp_eid, instanceId);
-        if (requesterRc != PLDM_REQUESTER_SUCCESS)
-        {
-            std::cerr << "Failed to send msg to fetch pdrs, rc = "
-                      << requesterRc << std::endl;
-            return;
-        }
-
-        uint8_t completionCode{};
-        uint32_t nextDataTransferHandle{};
-        uint8_t transferFlag{};
-        uint16_t respCount{};
-        uint8_t transferCRC{};
-        auto responsePtr =
-            reinterpret_cast<struct pldm_msg*>(responseMsgPtr.get());
-        rc = decode_get_pdr_resp(
-            responsePtr, responseMsgSize - sizeof(pldm_msg_hdr),
-            &completionCode, &nextRecordHandle, &nextDataTransferHandle,
-            &transferFlag, &respCount, nullptr, 0, &transferCRC);
-
-        std::vector<uint8_t> responsePDRMsg;
-        responsePDRMsg.resize(responseMsgSize);
-        memcpy(responsePDRMsg.data(), responsePtr, responsePDRMsg.size());
-        if (verbose)
-        {
-            std::cout << "Receiving Msg:" << std::endl;
-            printBuffer(responsePDRMsg, verbose);
-        }
-        if (rc != PLDM_SUCCESS)
-        {
-            std::cerr << "Failed to decode_get_pdr_resp, rc = " << rc
-                      << std::endl;
-        }
-        else
-        {
-            std::vector<uint8_t> pdr(respCount, 0);
-            rc = decode_get_pdr_resp(
-                responsePtr, responseMsgSize - sizeof(pldm_msg_hdr),
-                &completionCode, &nextRecordHandle, &nextDataTransferHandle,
-                &transferFlag, &respCount, pdr.data(), respCount, &transferCRC);
-            if (rc != PLDM_SUCCESS || completionCode != PLDM_SUCCESS)
-            {
-                std::cerr << "Failed to decode_get_pdr_resp: "
-                          << "rc=" << rc
-                          << ", cc=" << static_cast<unsigned>(completionCode)
-                          << std::endl;
-            }
-            else
-            {
-                // Process the PDR host firmware sent us. The most common action
-                // is to add the PDR to the the BMC's PDR repo.
-                auto pdrHdr = reinterpret_cast<pldm_pdr_hdr*>(pdr.data());
-                if (pdrHdr->type == PLDM_PDR_ENTITY_ASSOCIATION)
-                {
-                    mergeEntityAssociations(pdr);
-                    merged = true;
-                }
-                else
-                {
-                    if (pdrHdr->type == PLDM_TERMINUS_LOCATOR_PDR)
-                    {
-                        auto tlpdr =
-                            reinterpret_cast<const pldm_terminus_locator_pdr*>(
-                                pdr.data());
-                        tlpdrInfo.emplace(
-                            static_cast<pdr::TerminusHandle>(
-                                tlpdr->terminus_handle),
-                            static_cast<pdr::TerminusID>(tlpdr->tid));
-                    }
-                    else if (pdrHdr->type == PLDM_STATE_SENSOR_PDR)
-                    {
-                        stateSensorPDRs.emplace_back(pdr);
-                    }
-                    pldm_pdr_add(repo, pdr.data(), respCount, 0, true);
-                }
-            }
-
-            recordHandle = nextRecordHandle;
-            if (!pdrRecordHandles.empty())
-            {
-                recordHandle = pdrRecordHandles.front();
-                pdrRecordHandles.pop_front();
-            }
-            else if (isFormatRecHandles)
-            {
-                break;
-            }
-        }
-    } while (recordHandle);
-
-    parseStateSensorPDRs(stateSensorPDRs, tlpdrInfo);
-
-    if (merged)
-    {
-        // We have merged host's entity association PDRs with our own. Send an
-        // event to the host firmware to indicate the same.
-        sendPDRRepositoryChgEvent(
-            std::move(std::vector<uint8_t>(1, PLDM_PDR_ENTITY_ASSOCIATION)),
-            FORMAT_IS_PDR_HANDLES);
+        std::cerr << "Failed to send the GetPDR request to Host \n";
     }
 }
 
@@ -400,7 +302,7 @@
         auto rc = decode_platform_event_message_resp(
             responsePtr, respMsgLen - sizeof(pldm_msg_hdr), &completionCode,
             &status);
-        if (rc != PLDM_SUCCESS || completionCode != PLDM_SUCCESS)
+        if (rc || completionCode)
         {
             std::cerr << "Failed to decode_platform_event_message_resp: "
                       << "rc=" << rc
@@ -409,10 +311,10 @@
         }
     };
 
-    rc = handler.registerRequest(
+    rc = handler->registerRequest(
         mctp_eid, instanceId, PLDM_PLATFORM, PLDM_PDR_REPOSITORY_CHG_EVENT,
         std::move(requestMsg), std::move(platformEventMessageResponseHandler));
-    if (rc != PLDM_SUCCESS)
+    if (rc)
     {
         std::cerr << "Failed to send the PDR repository changed event request"
                   << "\n";
@@ -442,4 +344,131 @@
     }
 }
 
+void HostPDRHandler::processHostPDRs(mctp_eid_t /*eid*/,
+                                     const pldm_msg* response,
+                                     size_t respMsgLen)
+{
+    static bool merged = false;
+    static PDRList stateSensorPDRs{};
+    static TLPDRMap tlpdrInfo{};
+    uint32_t nextRecordHandle{};
+    uint8_t completionCode{};
+    uint32_t nextDataTransferHandle{};
+    uint8_t transferFlag{};
+    uint16_t respCount{};
+    uint8_t transferCRC{};
+    if (response == nullptr || !respMsgLen)
+    {
+        std::cerr << "Failed to receive response for the GetPDR"
+                     " command \n";
+        return;
+    }
+
+    auto rc = decode_get_pdr_resp(
+        response, respMsgLen /*- sizeof(pldm_msg_hdr)*/, &completionCode,
+        &nextRecordHandle, &nextDataTransferHandle, &transferFlag, &respCount,
+        nullptr, 0, &transferCRC);
+    std::vector<uint8_t> responsePDRMsg;
+    responsePDRMsg.resize(respMsgLen + sizeof(pldm_msg_hdr));
+    memcpy(responsePDRMsg.data(), response, respMsgLen + sizeof(pldm_msg_hdr));
+    if (verbose)
+    {
+        std::cout << "Receiving Msg:" << std::endl;
+        printBuffer(responsePDRMsg, verbose);
+    }
+    if (rc != PLDM_SUCCESS)
+    {
+        std::cerr << "Failed to decode_get_pdr_resp, rc = " << rc << std::endl;
+        return;
+    }
+    else
+    {
+        std::vector<uint8_t> pdr(respCount, 0);
+        rc = decode_get_pdr_resp(response, respMsgLen, &completionCode,
+                                 &nextRecordHandle, &nextDataTransferHandle,
+                                 &transferFlag, &respCount, pdr.data(),
+                                 respCount, &transferCRC);
+        if (rc != PLDM_SUCCESS || completionCode != PLDM_SUCCESS)
+        {
+            std::cerr << "Failed to decode_get_pdr_resp: "
+                      << "rc=" << rc
+                      << ", cc=" << static_cast<unsigned>(completionCode)
+                      << std::endl;
+            return;
+        }
+        else
+        {
+            auto pdrHdr = reinterpret_cast<pldm_pdr_hdr*>(pdr.data());
+            if (pdrHdr->type == PLDM_PDR_ENTITY_ASSOCIATION)
+            {
+                this->mergeEntityAssociations(pdr);
+                merged = true;
+            }
+            else
+            {
+                if (pdrHdr->type == PLDM_TERMINUS_LOCATOR_PDR)
+                {
+                    auto tlpdr =
+                        reinterpret_cast<const pldm_terminus_locator_pdr*>(
+                            pdr.data());
+                    tlpdrInfo.emplace(
+                        static_cast<pldm::pdr::TerminusHandle>(
+                            tlpdr->terminus_handle),
+                        static_cast<pldm::pdr::TerminusID>(tlpdr->tid));
+                }
+                else if (pdrHdr->type == PLDM_STATE_SENSOR_PDR)
+                {
+                    stateSensorPDRs.emplace_back(pdr);
+                }
+                pldm_pdr_add(repo, pdr.data(), respCount, 0, true);
+            }
+        }
+    }
+    if (!nextRecordHandle)
+    {
+        /*received last record*/
+        this->parseStateSensorPDRs(stateSensorPDRs, tlpdrInfo);
+        stateSensorPDRs.clear();
+        tlpdrInfo.clear();
+        if (merged)
+        {
+            merged = false;
+            deferredPDRRepoChgEvent =
+                std::make_unique<sdeventplus::source::Defer>(
+                    event,
+                    std::bind(
+                        std::mem_fn((&HostPDRHandler::_processPDRRepoChgEvent)),
+                        this, std::placeholders::_1));
+        }
+    }
+    else
+    {
+        deferredFetchPDREvent = std::make_unique<sdeventplus::source::Defer>(
+            event,
+            std::bind(std::mem_fn((&HostPDRHandler::_processFetchPDREvent)),
+                      this, nextRecordHandle, std::placeholders::_1));
+    }
+}
+
+void HostPDRHandler::_processPDRRepoChgEvent(
+    sdeventplus::source::EventBase& /*source */)
+{
+    deferredPDRRepoChgEvent.reset();
+    this->sendPDRRepositoryChgEvent(
+        std::move(std::vector<uint8_t>(1, PLDM_PDR_ENTITY_ASSOCIATION)),
+        FORMAT_IS_PDR_HANDLES);
+}
+
+void HostPDRHandler::_processFetchPDREvent(
+    uint32_t nextRecordHandle, sdeventplus::source::EventBase& /*source */)
+{
+    deferredFetchPDREvent.reset();
+    if (!this->pdrRecordHandles.empty())
+    {
+        nextRecordHandle = this->pdrRecordHandles.front();
+        this->pdrRecordHandles.pop_front();
+    }
+    this->getHostPDR(nextRecordHandle);
+}
+
 } // namespace pldm
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index 5ca8f91..2e0d331 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -93,7 +93,7 @@
         pldm_pdr* repo, const std::string& eventsJsonsDir,
         pldm_entity_association_tree* entityTree,
         pldm_entity_association_tree* bmcEntityTree, Requester& requester,
-        pldm::requester::Handler<pldm::requester::Request>& handler,
+        pldm::requester::Handler<pldm::requester::Request>* handler,
         bool verbose = false);
 
     /** @brief fetch PDRs from host firmware. See @class.
@@ -145,12 +145,19 @@
                               const TLPDRMap& tlpdrInfo);
 
   private:
-    /** @brief fetchPDR schedules work on the event loop, this method does the
-     *  actual work. This is so that the PDR exchg with the host is async.
+    /** @brief deferred function to fetch PDR from Host, scheduled to work on
+     *  the event loop. The PDR exchg with the host is async.
      *  @param[in] source - sdeventplus event source
      */
     void _fetchPDR(sdeventplus::source::EventBase& source);
 
+    /** @brief this function sends a GetPDR request to Host firmware.
+     *  And processes the PDRs based on type
+     *
+     *  @param[in] - nextRecordHandle - the next record handle to ask for
+     */
+    void getHostPDR(uint32_t nextRecordHandle = 0);
+
     /** @brief Merge host firmware's entity association PDRs into BMC's
      *  @details A merge operation involves adding a pldm_entity under the
      *  appropriate parent, and updating container ids.
@@ -166,6 +173,26 @@
      */
     bool getParent(EntityType type, pldm_entity& parent);
 
+    /** @brief process the Host's PDR and add to BMC's PDR repo
+     *  @param[in] eid - MCTP id of Host
+     *  @param[in] response - response from Host for GetPDR
+     *  @param[in] respMsgLen - response message length
+     */
+    void processHostPDRs(mctp_eid_t eid, const pldm_msg* response,
+                         size_t respMsgLen);
+
+    /** @brief send PDR Repo change after merging Host's PDR to BMC PDR repo
+     *  @param[in] source - sdeventplus event source
+     */
+    void _processPDRRepoChgEvent(sdeventplus::source::EventBase& source);
+
+    /** @brief fetch the next PDR based on the record handle sent by Host
+     *  @param[in] nextRecordHandle - next record handle
+     *  @param[in] source - sdeventplus event source
+     */
+    void _processFetchPDREvent(uint32_t nextRecordHandle,
+                               sdeventplus::source::EventBase& source);
+
     /** @brief fd of MCTP communications socket */
     int mctp_fd;
     /** @brief MCTP EID of host firmware */
@@ -190,10 +217,13 @@
     Requester& requester;
 
     /** @brief PLDM request handler */
-    pldm::requester::Handler<pldm::requester::Request>& handler;
+    pldm::requester::Handler<pldm::requester::Request>* handler;
 
     /** @brief sdeventplus event source */
     std::unique_ptr<sdeventplus::source::Defer> pdrFetchEvent;
+    std::unique_ptr<sdeventplus::source::Defer> deferredFetchPDREvent;
+    std::unique_ptr<sdeventplus::source::Defer> deferredPDRRepoChgEvent;
+
     /** @brief list of PDR record handles pointing to host's PDRs */
     PDRRecordHandles pdrRecordHandles;
     /** @brief maps an entity type to parent pldm_entity from the BMC's entity
diff --git a/host-bmc/test/dbus_to_host_effecter_test.cpp b/host-bmc/test/dbus_to_host_effecter_test.cpp
index 72b820d..76025eb 100644
--- a/host-bmc/test/dbus_to_host_effecter_test.cpp
+++ b/host-bmc/test/dbus_to_host_effecter_test.cpp
@@ -18,7 +18,7 @@
     MockHostEffecterParser(int fd, const pldm_pdr* repo,
                            DBusHandler* const dbusHandler,
                            const std::string& jsonPath) :
-        HostEffecterParser(nullptr, fd, repo, dbusHandler, jsonPath)
+        HostEffecterParser(nullptr, fd, repo, dbusHandler, jsonPath, nullptr)
     {}
 
     MOCK_METHOD(void, setHostStateEffecter,
diff --git a/host-bmc/test/meson.build b/host-bmc/test/meson.build
index 2254a3a..c7f0532 100644
--- a/host-bmc/test/meson.build
+++ b/host-bmc/test/meson.build
@@ -2,7 +2,8 @@
           sources: [
             '../dbus_to_host_effecters.cpp',
             '../../pldmd/dbus_impl_requester.cpp',
-            '../../pldmd/instance_id.cpp'])
+            '../../pldmd/instance_id.cpp'],
+            include_directories: '../../requester')
 
 tests = [
   'dbus_to_host_effecter_test',
@@ -20,6 +21,7 @@
                          libpldm_dep,
                          libpldmutils,
                          phosphor_dbus_interfaces,
-                         sdbusplus]),
+                         sdbusplus,
+                         sdeventplus]),
        workdir: meson.current_source_dir())
 endforeach
