diff --git a/src/detail/face-impl.hpp b/src/detail/face-impl.hpp
index 92f102f..a7c332d 100644
--- a/src/detail/face-impl.hpp
+++ b/src/detail/face-impl.hpp
@@ -45,8 +45,6 @@
 
 namespace ndn {
 
-using ndn::nfd::ControlParameters;
-
 /**
  * @brief implementation detail of Face
  */
@@ -188,7 +186,7 @@
                  uint64_t flags,
                  const nfd::CommandOptions& options)
   {
-    ControlParameters params;
+    nfd::ControlParameters params;
     params.setName(prefix);
     params.setFlags(flags);
 
@@ -196,8 +194,8 @@
 
     m_face.m_nfdController->start<nfd::RibRegisterCommand>(
       params,
-      [=] (const ControlParameters&) { this->afterPrefixRegistered(prefixToRegister, onSuccess); },
-      [=] (uint32_t code, const std::string& reason) { onFailure(prefixToRegister->getPrefix(), reason); },
+      [=] (const nfd::ControlParameters&) { this->afterPrefixRegistered(prefixToRegister, onSuccess); },
+      [=] (const nfd::ControlResponse& resp) { onFailure(prefixToRegister->getPrefix(), resp.getText()); },
       options);
 
     return reinterpret_cast<const RegisteredPrefixId*>(prefixToRegister.get());
@@ -236,12 +234,12 @@
         m_interestFilterTable.remove(filter);
       }
 
-      ControlParameters params;
+      nfd::ControlParameters params;
       params.setName(record.getPrefix());
       m_face.m_nfdController->start<nfd::RibUnregisterCommand>(
         params,
-        [=] (const ControlParameters&) { this->finalizeUnregisterPrefix(i, onSuccess); },
-        [=] (uint32_t code, const std::string& reason) { onFailure(reason); },
+        [=] (const nfd::ControlParameters&) { this->finalizeUnregisterPrefix(i, onSuccess); },
+        [=] (const nfd::ControlResponse& resp) { onFailure(resp.getText()); },
         record.getCommandOptions());
     }
     else {
diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 72299f0..b395d6b 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -20,7 +20,8 @@
  */
 
 #include "nfd-controller.hpp"
-#include "nfd-control-response.hpp"
+#include "../face.hpp"
+#include "../security/key-chain.hpp"
 #include "../util/segment-fetcher.hpp"
 
 namespace ndn {
@@ -52,7 +53,7 @@
   const CommandSucceedCallback& onSuccess = onSuccess1 ?
     onSuccess1 : [] (const ControlParameters&) {};
   const CommandFailCallback& onFailure = onFailure1 ?
-    onFailure1 : [] (uint32_t, const std::string&) {};
+    onFailure1 : [] (const ControlResponse&) {};
 
   Name requestName = command->getRequestName(options.getPrefix(), parameters);
   Interest interest(requestName);
@@ -60,10 +61,15 @@
   m_keyChain.sign(interest, options.getSigningInfo());
 
   m_face.expressInterest(interest,
-                         bind(&Controller::processCommandResponse, this, _2,
-                              command, onSuccess, onFailure),
-                         bind(onFailure, ERROR_NACK, "network Nack received"),
-                         bind(onFailure, ERROR_TIMEOUT, "request timed out"));
+    [=] (const Interest&, const Data& data) {
+      this->processCommandResponse(data, command, onSuccess, onFailure);
+    },
+    [=] (const Interest&, const lp::Nack&) {
+      onFailure(ControlResponse(Controller::ERROR_NACK, "network Nack received"));
+    },
+    [=] (const Interest&) {
+      onFailure(ControlResponse(Controller::ERROR_TIMEOUT, "request timed out"));
+    });
 }
 
 void
@@ -77,7 +83,7 @@
       this->processValidatedCommandResponse(*data, command, onSuccess, onFailure);
     },
     [=] (const shared_ptr<const Data>&, const std::string& msg) {
-      onFailure(ERROR_VALIDATION, msg);
+      onFailure(ControlResponse(ERROR_VALIDATION, msg));
     }
   );
 }
@@ -93,13 +99,13 @@
     response.wireDecode(data.getContent().blockFromValue());
   }
   catch (const tlv::Error& e) {
-    onFailure(ERROR_SERVER, e.what());
+    onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
   uint32_t code = response.getCode();
   if (code >= ERROR_LBOUND) {
-    onFailure(code, response.getText());
+    onFailure(response);
     return;
   }
 
@@ -108,7 +114,7 @@
     parameters.wireDecode(response.getBody());
   }
   catch (const tlv::Error& e) {
-    onFailure(ERROR_SERVER, e.what());
+    onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
@@ -116,7 +122,7 @@
     command->validateResponse(parameters);
   }
   catch (const ControlCommand::ArgumentError& e) {
-    onFailure(ERROR_SERVER, e.what());
+    onFailure(ControlResponse(ERROR_SERVER, e.what()));
     return;
   }
 
@@ -126,7 +132,7 @@
 void
 Controller::fetchDataset(const Name& prefix,
                          const std::function<void(const ConstBufferPtr&)>& processResponse,
-                         const CommandFailCallback& onFailure,
+                         const DatasetFailCallback& onFailure,
                          const CommandOptions& options)
 {
   Interest baseInterest(prefix);
@@ -137,7 +143,7 @@
 }
 
 void
-Controller::processDatasetFetchError(const CommandFailCallback& onFailure,
+Controller::processDatasetFetchError(const DatasetFailCallback& onFailure,
                                      uint32_t code, std::string msg)
 {
   switch (static_cast<SegmentFetcher::ErrorCode>(code)) {
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index f1d6df9..297f113 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -23,13 +23,19 @@
 #define NDN_MANAGEMENT_NFD_CONTROLLER_HPP
 
 #include "nfd-control-command.hpp"
+#include "nfd-control-response.hpp"
 #include "nfd-status-dataset.hpp"
 #include "nfd-command-options.hpp"
-#include "../face.hpp"
-#include "../security/key-chain.hpp"
 #include "../security/validator-null.hpp"
 
 namespace ndn {
+
+namespace security {
+class KeyChain;
+} // namespace security
+class Face;
+class Validator;
+
 namespace nfd {
 
 /**
@@ -39,7 +45,8 @@
 
 /**
  * \ingroup management
- * \brief NFD Management protocol - ControlCommand client
+ * \brief NFD Management protocol client
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/Management
  */
 class Controller : noncopyable
 {
@@ -50,12 +57,16 @@
 
   /** \brief a callback on command failure
    */
-  typedef function<void(uint32_t code, const std::string& reason)> CommandFailCallback;
+  typedef function<void(const ControlResponse&)> CommandFailCallback;
+
+  /** \brief a callback on dataset retrieval failure
+   */
+  typedef function<void(uint32_t code, const std::string& reason)> DatasetFailCallback;
 
   /** \brief construct a Controller that uses face for transport,
    *         and uses the passed KeyChain to sign commands
    */
-  Controller(Face& face, KeyChain& keyChain, Validator& validator = s_validatorNull);
+  Controller(Face& face, security::KeyChain& keyChain, Validator& validator = s_validatorNull);
 
   /** \brief start command execution
    */
@@ -75,7 +86,7 @@
   template<typename Dataset>
   typename std::enable_if<std::is_default_constructible<Dataset>::value>::type
   fetch(const std::function<void(typename Dataset::ResultType)>& onSuccess,
-        const CommandFailCallback& onFailure,
+        const DatasetFailCallback& onFailure,
         const CommandOptions& options = CommandOptions())
   {
     this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
@@ -87,7 +98,7 @@
   void
   fetch(const ParamType& param,
         const std::function<void(typename Dataset::ResultType)>& onSuccess,
-        const CommandFailCallback& onFailure,
+        const DatasetFailCallback& onFailure,
         const CommandOptions& options = CommandOptions())
   {
     this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
@@ -117,24 +128,24 @@
   void
   fetchDataset(shared_ptr<Dataset> dataset,
                const std::function<void(typename Dataset::ResultType)>& onSuccess,
-               const CommandFailCallback& onFailure,
+               const DatasetFailCallback& onFailure,
                const CommandOptions& options);
 
   void
   fetchDataset(const Name& prefix,
                const std::function<void(const ConstBufferPtr&)>& processResponse,
-               const CommandFailCallback& onFailure,
+               const DatasetFailCallback& onFailure,
                const CommandOptions& options);
 
   template<typename Dataset>
   void
   processDatasetResponse(shared_ptr<Dataset> dataset,
                          const std::function<void(typename Dataset::ResultType)>& onSuccess,
-                         const CommandFailCallback& onFailure,
+                         const DatasetFailCallback& onFailure,
                          ConstBufferPtr payload);
 
   void
-  processDatasetFetchError(const CommandFailCallback& onFailure, uint32_t code, std::string msg);
+  processDatasetFetchError(const DatasetFailCallback& onFailure, uint32_t code, std::string msg);
 
 public:
   /** \brief error code for timeout
@@ -159,7 +170,7 @@
 
 protected:
   Face& m_face;
-  KeyChain& m_keyChain;
+  security::KeyChain& m_keyChain;
   Validator& m_validator;
 
 private:
@@ -170,12 +181,12 @@
 inline void
 Controller::fetchDataset(shared_ptr<Dataset> dataset,
                          const std::function<void(typename Dataset::ResultType)>& onSuccess1,
-                         const CommandFailCallback& onFailure1,
+                         const DatasetFailCallback& onFailure1,
                          const CommandOptions& options)
 {
   const std::function<void(typename Dataset::ResultType)>& onSuccess = onSuccess1 ?
     onSuccess1 : [] (const typename Dataset::ResultType&) {};
-  const CommandFailCallback& onFailure = onFailure1 ?
+  const DatasetFailCallback& onFailure = onFailure1 ?
     onFailure1 : [] (uint32_t, const std::string&) {};
 
   Name prefix = dataset->getDatasetPrefix(options.getPrefix());
@@ -189,15 +200,15 @@
 inline void
 Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
                                    const std::function<void(typename Dataset::ResultType)>& onSuccess,
-                                   const CommandFailCallback& onFailure,
+                                   const DatasetFailCallback& onFailure,
                                    ConstBufferPtr payload)
 {
   typename Dataset::ResultType result;
   try {
     result = dataset->parseResult(payload);
   }
-  catch (const tlv::Error& ex) {
-    onFailure(ERROR_SERVER, ex.what());
+  catch (const tlv::Error& e) {
+    onFailure(ERROR_SERVER, e.what());
     return;
   }
 
