diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 4018161..bbefa44 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -5,7 +5,6 @@
  */
 
 #include "tcp-channel.hpp"
-#include "tcp-face.hpp"
 
 namespace ndn {
 
@@ -19,7 +18,9 @@
 }
 
 void
-TcpChannel::listen(int backlog/* = tcp::acceptor::max_connections*/)
+TcpChannel::listen(const FaceCreatedCallback& onFaceCreated,
+                   const ConnectFailedCallback& onAcceptFailed,
+                   int backlog/* = tcp::acceptor::max_connections*/)
 {
   m_acceptor = make_shared<ip::tcp::acceptor>(boost::ref(m_ioService));
   m_acceptor->open(m_localEndpoint.protocol());
@@ -30,12 +31,15 @@
   shared_ptr<ip::tcp::socket> clientSocket =
     make_shared<ip::tcp::socket>(boost::ref(m_ioService));
   m_acceptor->async_accept(*clientSocket,
-                           bind(&TcpChannel::handleConnection, this,
-                                _1, clientSocket));
+                           bind(&TcpChannel::handleConnection, this, _1,
+                                clientSocket,
+                                onFaceCreated, onAcceptFailed));
 }
 
 void
 TcpChannel::connect(const tcp::Endpoint& remoteEndpoint,
+                    const TcpChannel::FaceCreatedCallback& onFaceCreated,
+                    const TcpChannel::ConnectFailedCallback& onConnectFailed,
                     const time::Duration& timeout/* = time::seconds(4)*/)
 {
   shared_ptr<ip::tcp::socket> clientSocket =
@@ -49,16 +53,20 @@
   clientSocket->bind(m_localEndpoint);
 
   clientSocket->async_connect(remoteEndpoint,
-                              bind(&TcpChannel::handleSuccessfulConnect, this,
-                                   _1, clientSocket, connectTimeoutTimer));
+                              bind(&TcpChannel::handleSuccessfulConnect, this, _1,
+                                   clientSocket, connectTimeoutTimer,
+                                   onFaceCreated, onConnectFailed));
 
   connectTimeoutTimer->expires_from_now(timeout);
-  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this,
-                                       _1, clientSocket, connectTimeoutTimer));
+  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this, _1,
+                                       clientSocket, connectTimeoutTimer,
+                                       onConnectFailed));
 }
 
 void
 TcpChannel::connect(const std::string& remoteHost, const std::string& remotePort,
+                    const TcpChannel::FaceCreatedCallback& onFaceCreated,
+                    const TcpChannel::ConnectFailedCallback& onConnectFailed,
                     const time::Duration& timeout/* = time::seconds(4)*/)
 {
   shared_ptr<ip::tcp::socket> clientSocket =
@@ -77,17 +85,21 @@
 
   resolver->async_resolve(query,
                           bind(&TcpChannel::handleEndpointResoution, this, _1, _2,
-                               clientSocket, connectTimeoutTimer));
+                               clientSocket, connectTimeoutTimer,
+                               onFaceCreated, onConnectFailed));
 
   connectTimeoutTimer->expires_from_now(timeout);
-  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this,
-                                       _1, clientSocket, connectTimeoutTimer));
+  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this, _1,
+                                       clientSocket, connectTimeoutTimer,
+                                       onConnectFailed));
 }
 
 
 void
 TcpChannel::handleConnection(const boost::system::error_code& error,
-                             const shared_ptr<ip::tcp::socket>& socket)
+                             const shared_ptr<ip::tcp::socket>& socket,
+                             const FaceCreatedCallback& onFaceCreated,
+                             const ConnectFailedCallback& onConnectFailed)
 {
   if (error) {
     if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
@@ -100,17 +112,18 @@
   }
 
   /**
-   * \todo Either remove FaceId from here or set it here to some real value
+   * \todo Remove FaceId from here
    */
   shared_ptr<TcpFace> face = make_shared<TcpFace>(1, boost::cref(socket));
-
-  // what's next?
+  onFaceCreated(face);
 }
 
 void
 TcpChannel::handleSuccessfulConnect(const boost::system::error_code& error,
                                     const shared_ptr<ip::tcp::socket>& socket,
-                                    const shared_ptr<monotonic_deadline_timer>& timer)
+                                    const shared_ptr<monotonic_deadline_timer>& timer,
+                                    const FaceCreatedCallback& onFaceCreated,
+                                    const ConnectFailedCallback& onConnectFailed)
 {
   timer->cancel();
 
@@ -124,13 +137,14 @@
     return;
   }
 
-  handleConnection(error, socket);
+  handleConnection(error, socket, onFaceCreated, onConnectFailed);
 }
 
 void
 TcpChannel::handleFailedConnect(const boost::system::error_code& error,
                                 const shared_ptr<ip::tcp::socket>& socket,
-                                const shared_ptr<monotonic_deadline_timer>& timer)
+                                const shared_ptr<monotonic_deadline_timer>& timer,
+                                const ConnectFailedCallback& onConnectFailed)
 {
   if (error) { // e.g., cancelled
     return;
@@ -145,7 +159,9 @@
 TcpChannel::handleEndpointResoution(const boost::system::error_code& error,
                                     ip::tcp::resolver::iterator remoteEndpoint,
                                     const shared_ptr<boost::asio::ip::tcp::socket>& socket,
-                                    const shared_ptr<boost::asio::monotonic_deadline_timer>& timer)
+                                    const shared_ptr<boost::asio::monotonic_deadline_timer>& timer,
+                                    const FaceCreatedCallback& onFaceCreated,
+                                    const ConnectFailedCallback& onConnectFailed)
 {
   if (error ||
       remoteEndpoint == ip::tcp::resolver::iterator())
@@ -162,8 +178,9 @@
 
   // got endpoint, now trying to connect (only try the first resolution option)
   socket->async_connect(*remoteEndpoint,
-                        bind(&TcpChannel::handleSuccessfulConnect, this,
-                             _1, socket, timer));
+                        bind(&TcpChannel::handleSuccessfulConnect, this, _1,
+                             socket, timer,
+                             onFaceCreated, onConnectFailed));
 }
 
 
