diff --git a/examples/custom-apps/ndn-api-app.cc b/examples/custom-apps/ndn-api-app.cc
new file mode 100644
index 0000000..3df6a27
--- /dev/null
+++ b/examples/custom-apps/ndn-api-app.cc
@@ -0,0 +1,70 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ndn-api-app.h"
+
+NS_LOG_COMPONENT_DEFINE ("ndn.ApiApp");
+
+namespace ns3 {
+namespace ndn {
+
+// Necessary if you are planning to use ndn::AppHelper
+NS_OBJECT_ENSURE_REGISTERED (ApiApp);
+
+TypeId
+ApiApp::GetTypeId ()
+{
+  static TypeId tid = TypeId ("ns3::ndn::ApiApp")
+    .SetParent<Application> ()
+    .AddConstructor<ApiApp> ()
+    ;
+
+  return tid;
+}
+
+ApiApp::ApiApp ()
+{
+  m_handler = CreateObject<Handler> ();
+}
+
+void
+ApiApp::RequestData ()
+{
+  m_handler->sendInterest ("/test/prefix", boost::bind (&ApiApp::OnData
+}
+
+void
+ApiApp::StartApplication ()
+{
+  m_handler->SetNode (GetNode ());
+  m_handler->StartApplication ();
+  
+  Simulator::Schedule (Seconds (1), &::ns3::ndn::ApiApp::RequestData, this);
+}
+
+void
+ApiApp::StopApplication ()
+{
+  m_handler->StopApplication ();
+}
+
+} // namespace ndn
+} // namespace ns3
+
diff --git a/examples/custom-apps/ndn-api-app.h b/examples/custom-apps/ndn-api-app.h
new file mode 100644
index 0000000..26df590
--- /dev/null
+++ b/examples/custom-apps/ndn-api-app.h
@@ -0,0 +1,60 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef NDN_EXAMPLES_API_APP_H
+#define NDN_EXAMPLES_API_APP_H
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/ndnSIM-module.h"
+
+#include "ns3/ndnSIM/ndn.cxx/ndn-handler.h"
+
+namespace ns3 {
+namespace ndn {
+
+class ApiApp : public Application
+{
+public:
+  static TypeId
+  GetTypeId ();
+
+  ApiApp ();
+
+private:
+  void
+  RequestData ();
+  
+protected:
+  // inherited from Application base class.
+  virtual void
+  StartApplication ();
+
+  virtual void
+  StopApplication ();
+
+private:
+  Ptr<Handler> m_handler;
+};
+
+} // namespace ndn
+} // namespace ns3
+
+#endif // NDN_EXAMPLES_API_APP_H
diff --git a/examples/ndn-simple-api.cc b/examples/ndn-simple-api.cc
new file mode 100644
index 0000000..ba79af7
--- /dev/null
+++ b/examples/ndn-simple-api.cc
@@ -0,0 +1,96 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+// ndn-simple.cc
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/ndnSIM-module.h"
+
+using namespace ns3;
+
+/**
+ * This scenario simulates a very simple network topology:
+ *
+ *
+ *      +----------+     1Mbps      +--------+     1Mbps      +----------+
+ *      | consumer | <------------> | router | <------------> | producer |
+ *      +----------+         10ms   +--------+          10ms  +----------+
+ *
+ *
+ * Consumer requests data from producer with frequency 10 interests per second
+ * (interests contain constantly increasing sequence number).
+ *
+ * For every received interest, producer replies with a data packet, containing
+ * 1024 bytes of virtual payload.
+ *
+ * To run scenario and see what is happening, use the following command:
+ *
+ *     NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-simple
+ */
+
+int 
+main (int argc, char *argv[])
+{
+  // setting default parameters for PointToPoint links and channels
+  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
+  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
+  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+
+  // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  // Creating nodes
+  NodeContainer nodes;
+  nodes.Create (3);
+
+  // Connecting nodes using two links
+  PointToPointHelper p2p;
+  p2p.Install (nodes.Get (0), nodes.Get (1));
+  p2p.Install (nodes.Get (1), nodes.Get (2));
+
+  // Install NDN stack on all nodes
+  ndn::StackHelper ndnHelper;
+  ndnHelper.SetDefaultRoutes (true);
+  ndnHelper.InstallAll ();
+
+  // Installing applications
+
+  // Consumer
+  ndn::AppHelper consumerHelper ("ns3::ndn::ApiApp");
+  // // Consumer will request /prefix/0, /prefix/1, ...
+  // consumerHelper.SetPrefix ("/prefix");
+  // consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
+  consumerHelper.Install (nodes.Get (0)); // first node
+
+  // Producer
+  ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+  // Producer will reply to all requests starting with /prefix
+  producerHelper.SetPrefix ("/prefix");
+  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
+  producerHelper.Install (nodes.Get (2)); // last node
+
+  Simulator::Stop (Seconds (20.0));
+
+  Simulator::Run ();
+  Simulator::Destroy ();
+
+  return 0;
+}
diff --git a/examples/wscript b/examples/wscript
index c9850ae..437ed26 100644
--- a/examples/wscript
+++ b/examples/wscript
@@ -85,3 +85,9 @@
 
     obj = bld.create_ns3_program('ndn-simple-with-pit-count-stats', all_modules)
     obj.source = 'ndn-simple-with-pit-count-stats.cc'
+
+    obj = bld.create_ns3_program('ndn-simple-api', all_modules)
+    obj.source = [
+        'ndn-simple-api.cc',
+        'custom-apps/ndn-api-app.cc'
+        ]
diff --git a/ndn.cxx/ndn-handler.cc b/ndn.cxx/ndn-handler.cc
new file mode 100644
index 0000000..c7c9e66
--- /dev/null
+++ b/ndn.cxx/ndn-handler.cc
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Chaoyi Bian <bcy@pku.edu.cn>
+ */
+
+#include "ndn-handler.h"
+
+#include <boost/throw_exception.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/lambda/bind.hpp>
+namespace ll = boost::lambda;
+
+#include <ns3/packet.h>
+
+#include <ns3/ndn-interest.h>
+#include <ns3/ndn-content-object.h>
+#include <ns3/ndn-face.h>
+#include <ns3/ndn-fib.h>
+#include <ns3/log.h>
+
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
+typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
+
+using namespace std;
+using namespace boost;
+using namespace ns3;
+
+#define INIT_LOGGER NS_LOG_COMPONENT_DEFINE
+#define _LOG_DEBUG NS_LOG_DEBUG
+#define _LOG_TRACE NS_LOG_TRACE
+#define _LOG_INFO NS_LOG_INFO
+
+
+INIT_LOGGER ("ndn.Handler");
+
+namespace ns3 {
+namespace ndn {
+
+Handler::Handler()
+  : m_rand (0, std::numeric_limits<uint32_t>::max ())
+{
+}
+
+Handler::~Handler()
+{
+}
+
+void
+Handler::StartApplication ()
+{
+  ndn::App::StartApplication ();
+}
+
+void
+Handler::StopApplication ()
+{
+  ndn::App::StopApplication ();
+}
+
+int
+Handler::publishRawData (const std::string &name, const char *buf, size_t len, int freshness)
+{
+  // NS_LOG_INFO ("Requesting Interest: \n" << interestHeader);
+  _LOG_INFO (">> publishRawData " << name);
+
+  static ndn::ContentObjectTail trailer;
+  
+  ndn::ContentObject data;
+  data.SetName (name);
+  data.SetFreshness (Seconds (freshness));
+
+  Ptr<Packet> packet = Create<Packet> (reinterpret_cast<const uint8_t*> (buf), len);
+  // packet->AddPacketTag (CreateObject<TypeTag> (TypeTag::DATA));
+  packet->AddHeader (data);
+  packet->AddTrailer (trailer);
+
+  m_protocolHandler (packet);
+
+  m_transmittedContentObjects (&data, packet, this, m_face);
+
+  return 0;
+}
+
+
+// void
+// RawDataCallback2StringDataCallback (Handler::StringDataCallback callback, std::string str, const char *buf, size_t len)
+// {
+//   callback (str, string (buf, len));
+// }
+
+// int
+// Handler::sendInterestForString (const std::string &strInterest, const StringDataCallback &strDataCallback/*, int retry*/)
+// {
+//   return sendInterest (strInterest, boost::bind (RawDataCallback2StringDataCallback, strDataCallback, _1, _2, _3));
+// }
+
+int Handler::sendInterest (const string &strInterest, const RawDataCallback &rawDataCallback)
+{
+  // NS_LOG_INFO ("Requesting Interest: \n" << interestHeader);
+  _LOG_INFO (">> I " << strInterest);
+  Ptr<ndn::Name> name = Create<ndn::Name> (strInterest);
+
+  ndn::Interest interestHeader;
+  interestHeader.SetNonce            (m_rand.GetValue ());
+  interestHeader.SetName             (*name);
+  interestHeader.SetInterestLifetime (Seconds (9.9)); // really long-lived interests
+
+  Ptr<Packet> packet = Create<Packet> ();
+  // packet->AddPacketTag (CreateObject<TypeTag> (TypeTag::INTEREST));
+  packet->AddHeader (interestHeader);
+
+  // NS_LOG_DEBUG (interestHeader);
+  
+  // Record the callback
+  FilterEntryContainer<RawDataCallback>::iterator entry = m_dataCallbacks.find_exact (*name);
+  if (entry == m_dataCallbacks.end ())
+    {
+      pair<FilterEntryContainer<RawDataCallback>::iterator, bool> status =
+        m_dataCallbacks.insert (*name, Create< FilterEntry<RawDataCallback> > (name));
+
+      entry = status.first;
+    }
+  entry->payload ()->AddCallback (rawDataCallback);
+
+  m_protocolHandler (packet);
+  m_transmittedInterests (&interestHeader, this, m_face);
+  
+  return 0;
+}
+
+int Handler::setInterestFilter (const string &prefix, const InterestCallback &interestCallback)
+{
+  NS_LOG_DEBUG ("== setInterestFilter " << prefix << " (" << GetNode ()->GetId () << ")");
+  Ptr<ndn::Name> name = Create<ndn::Name> (prefix);
+
+  FilterEntryContainer<InterestCallback>::iterator entry = m_interestCallbacks.find_exact (*name);
+  if (entry == m_interestCallbacks.end ())
+    {
+      pair<FilterEntryContainer<InterestCallback>::iterator, bool> status =
+        m_interestCallbacks.insert (*name, Create < FilterEntry<InterestCallback> > (name));
+
+      entry = status.first;
+    }
+
+  entry->payload ()->AddCallback (interestCallback);
+
+  // creating actual face
+  Ptr<ndn::Fib> fib = GetNode ()->GetObject<ndn::Fib> ();
+  Ptr<ndn::fib::Entry> fibEntry = fib->Add (name, m_face, 0);
+  fibEntry->UpdateStatus (m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);
+
+  return 0;
+}
+
+void
+Handler::clearInterestFilter (const std::string &prefix)
+{
+  Ptr<ndn::Name> name = Create<ndn::Name> (prefix);
+
+  FilterEntryContainer<InterestCallback>::iterator entry = m_interestCallbacks.find_exact (*name);
+  if (entry == m_interestCallbacks.end ())
+    return;
+
+  entry->payload ()->ClearCallback ();
+}
+
+void
+Handler::OnInterest (const Ptr<const ndn::Interest> &interest, Ptr<Packet> packet)
+{
+  ndn::App::OnInterest (interest, packet);
+
+  // the app cannot set several filters for the same prefix
+  FilterEntryContainer<InterestCallback>::iterator entry = m_interestCallbacks.longest_prefix_match (interest->GetName ());
+  if (entry == m_interestCallbacks.end ())
+    {
+      _LOG_DEBUG ("No Interest callback set");
+      return;
+    }
+  
+  entry->payload ()->m_callback (lexical_cast<string> (interest->GetName ()));  
+}
+
+void
+Handler::OnContentObject (const Ptr<const ndn::ContentObject> &contentObject,
+                              Ptr<Packet> payload)
+{
+  ndn::App::OnContentObject (contentObject, payload);
+  NS_LOG_DEBUG ("<< D " << contentObject->GetName ());
+
+  FilterEntryContainer<RawDataCallback>::iterator entry = m_dataCallbacks.longest_prefix_match (contentObject->GetName ());
+  if (entry == m_dataCallbacks.end ())
+    {
+      _LOG_DEBUG ("No Data callback set");
+      return;
+    }
+
+  while (entry != m_dataCallbacks.end ())
+    {
+      entry->payload ()->m_callback (lexical_cast<string> (contentObject->GetName ()), payload);
+      m_dataCallbacks.erase (entry);
+
+      entry = m_dataCallbacks.longest_prefix_match (contentObject->GetName ());
+    }
+}
+
+}
+}
diff --git a/ndn.cxx/ndn-handler.h b/ndn.cxx/ndn-handler.h
new file mode 100644
index 0000000..420645d
--- /dev/null
+++ b/ndn.cxx/ndn-handler.h
@@ -0,0 +1,179 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Chaoyi Bian <bcy@pku.edu.cn>
+ */
+
+#ifndef NDN_HANDLER_H
+#define NDN_HANDLER_H
+
+#include <boost/exception/all.hpp>
+#include <boost/function.hpp>
+#include <string>
+
+#include <ns3/ptr.h>
+#include <ns3/node.h>
+#include <ns3/random-variable.h>
+#include <ns3/ndn-app.h>
+#include <ns3/ndn-name.h>
+
+#include <ns3/ndnSIM/utils/trie/trie-with-policy.h>
+#include <ns3/ndnSIM/utils/trie/counting-policy.h>
+
+namespace ns3 {
+namespace ndn {
+
+template<class Callback>
+struct FilterEntry : public ns3::SimpleRefCount< FilterEntry<Callback> >
+{
+public:
+  FilterEntry (ns3::Ptr<const ns3::ndn::Name> prefix)
+    : m_prefix (prefix)
+  { }
+  
+  const ns3::ndn::Name &
+  GetPrefix () const
+  { return *m_prefix; }
+
+  void
+  AddCallback (Callback callback)
+  { 
+    m_callback = callback;
+  }
+
+  void
+  ClearCallback ()
+  {
+    m_callback = 0;
+  }
+  
+public:
+  ns3::Ptr<const ns3::ndn::Name> m_prefix; ///< \brief Prefix of the PIT entry
+  Callback m_callback;
+};
+
+
+template<class Callback>
+struct FilterEntryContainer :
+    public ns3::ndn::ndnSIM::trie_with_policy<ns3::ndn::Name,
+                                              ns3::ndn::ndnSIM::smart_pointer_payload_traits< FilterEntry<Callback> >,
+                                              ns3::ndn::ndnSIM::counting_policy_traits>
+{
+};
+
+
+struct OperationException : virtual boost::exception, virtual std::exception { };
+/**
+ * \ingroup sync
+ * @brief A handler for NDN; clients of this code do not need to deal
+ * with NDN API directly
+ */
+class Handler
+  : public ns3::ndn::App
+{
+public:
+  typedef boost::function<void (std::string, std::string)> StringDataCallback;
+  typedef boost::function<void (std::string, Ptr<Packet>)> RawDataCallback;
+  typedef boost::function<void (std::string)> InterestCallback;
+
+  
+  /**
+   * @brief initialize the handler; a lot of things needs to be done. 1) init
+   * keystore 2) init keylocator 3) start a thread to hold a loop of ccn_run
+   *
+   */
+  Handler();
+  ~Handler();
+
+  /**
+   * @brief send Interest; need to grab lock m_mutex first
+   *
+   * @param strInterest the Interest name
+   * @param dataCallback the callback function to deal with the returned data
+   * @return the return code of ccn_express_interest
+   */
+  // int
+  // sendInterestForString (const std::string &strInterest, const StringDataCallback &strDataCallback/*, int retry = 0*/);
+
+  int
+  sendInterest (const std::string &strInterest, const RawDataCallback &rawDataCallback/*, int retry = 0*/);
+  
+  /**
+   * @brief set Interest filter (specify what interest you want to receive)
+   *
+   * @param prefix the prefix of Interest
+   * @param interestCallback the callback function to deal with the returned data
+   * @return the return code of ccn_set_interest_filter
+   */
+  int
+  setInterestFilter (const std::string &prefix, const InterestCallback &interestCallback);
+
+  /**
+   * @brief clear Interest filter
+   * @param prefix the prefix of Interest
+   */
+  void
+  clearInterestFilter (const std::string &prefix);
+
+  /**
+   * @brief publish data and put it to local ccn content store; need to grab
+   * lock m_mutex first
+   *
+   * @param name the name for the data object
+   * @param dataBuffer the data to be published
+   * @param freshness the freshness time for the data object
+   * @return code generated by NDN library calls, >0 if success
+   */
+  int
+  publishStringData (const std::string &name, const std::string &dataBuffer, int freshness)
+  {
+    return publishRawData (name, dataBuffer.c_str(), dataBuffer.length(), freshness);
+  }
+
+  int
+  publishRawData (const std::string &name, const char *buf, size_t len, int freshness);
+  
+  // from ndn::App
+  virtual void
+  OnInterest (const ns3::Ptr<const ns3::ndn::Interest> &interest, ns3::Ptr<ns3::Packet> packet);
+ 
+  virtual void
+  OnContentObject (const ns3::Ptr<const ns3::ndn::ContentObject> &contentObject,
+                   ns3::Ptr<ns3::Packet> payload);
+
+
+public:
+  // inherited from Application base class.
+  virtual void
+  StartApplication ();    // Called at time specified by Start
+
+  virtual void
+  StopApplication ();     // Called at time specified by Stop
+
+private:
+  ns3::UniformVariable m_rand; // nonce generator
+
+  FilterEntryContainer<RawDataCallback> m_dataCallbacks;
+  FilterEntryContainer<InterestCallback> m_interestCallbacks;
+};
+
+}
+}
+
+#endif // NDN_HANDLER_H
diff --git a/wscript b/wscript
index 52f2892..8dbff90 100644
--- a/wscript
+++ b/wscript
@@ -108,12 +108,14 @@
                                        'apps/*.cc',
                                        'utils/**/*.cc',
                                        'helper/**/*.cc',
+                                       'ndn.cxx/**/*.cc',
                                        ])
     module.full_headers = [p.path_from(bld.path) for p in bld.path.ant_glob([
                            'utils/**/*.h',
                            'model/**/*.h',
                            'apps/**/*.h',
                            'helper/**/*.h',
+                           'ndn.cxx/**/*.h',
                            ])]
 
     headers.source = [
