diff --git a/src/content-server.cc b/src/content-server.cc
new file mode 100644
index 0000000..2432885
--- /dev/null
+++ b/src/content-server.cc
@@ -0,0 +1,113 @@
+/* -*- 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: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "content-server.h"
+
+using namespace Ccnx;
+using namespace std;
+
+ContentServer::ContentServer(CcnxWrapperPtr ccnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir)
+              : m_ccnx(ccnx)
+              , m_actionLog(actionLog)
+              , m_dbFolder(rootDir / ".chronoshare")
+{
+}
+
+ContentServer::~ContentServer()
+{
+  WriteLock lock(m_mutex);
+  int size = m_prefixes.size();
+  for (PrefixIt it = m_prefixes.begin(); it != m_prefixes.end(); ++it)
+  {
+    m_ccnx->clearInterestFilter(*it);
+  }
+}
+
+void
+ContentServer::registerPrefix(const Name &prefix)
+{
+  m_ccnx->setInterestFilter(prefix, bind(&ContentServer::serve, this, _1));
+  WriteLock lock(m_mutex);
+  m_prefixes.insert(prefix);
+}
+
+void
+ContentServer::deregisterPrefix(const Name &prefix)
+{
+  WriteLock lock(m_mutex);
+  PrefixIt it = m_prefixes.find(prefix);
+  if (it != m_prefixes.end())
+  {
+    m_ccnx->clearInterestFilter(*it);
+    m_prefixes.erase(it);
+  }
+}
+
+void
+ContentServer::serve(const Name &interest)
+{
+  ReadLock lock(m_mutex);
+  for (PrefixIt it = m_prefixes.begin(); it != m_prefixes.end(); ++it)
+  {
+    Name prefix = *it;
+    int prefixSize = prefix.size();
+    int interestSize = interest.size();
+    // this is the prefix of the interest
+    if (prefixSize <= interestSize && interest.getPartialName(0, prefixSize) == prefix)
+    {
+      // originalName should be either
+      // /device-name/file/file-hash/segment, or
+      // /device-name/action/shared-folder/seq
+      Name originalName = interest.getPartialName(prefixSize);
+      int nameSize = originalName.size();
+      if (nameSize > 3)
+      {
+        Name deviceName = originalName.getPartialName(0, nameSize - 3);
+        string type = originalName.getCompAsString(nameSize - 3);
+        BytesPtr co;
+        if (type == "action")
+        {
+          // TODO:
+          // get co from m_actionLog
+        }
+        else if (type == "file")
+        {
+          Bytes hashBytes = originalName.getComp(nameSize - 2);
+          Hash hash(head(hashBytes), hashBytes.size());
+          ostringstream oss;
+          oss << hash;
+          int64_t segment = originalName.getCompAsInt(nameSize - 1);
+          ObjectDb db(m_dbFolder, oss.str());
+          co = db.fetchSegment(deviceName, segment);
+        }
+        else
+        {
+          cerr << "Discard interest that ContentServer does not know how to handle: " << interest << ", prefix: " << prefix << endl;
+        }
+
+        if (co)
+        {
+          m_ccnx->publishData(interest, *co);
+        }
+      }
+    }
+  }
+}
diff --git a/src/content-server.h b/src/content-server.h
new file mode 100644
index 0000000..3eb2325
--- /dev/null
+++ b/src/content-server.h
@@ -0,0 +1,58 @@
+#ifndef CONTENT_SERVER_H
+#define CONTENT_SERVER_H
+/* -*- 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: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-wrapper.h"
+#include "object-db.h"
+#include "action-log.h"
+#include <set>
+#include <boost/thread/shared_mutex.hpp>
+#include <boost/thread/locks.hpp>
+
+class ContentServer
+{
+public:
+  ContentServer(Ccnx::CcnxWrapperPtr ccnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir);
+  ~ContentServer();
+
+  // the assumption is, when the interest comes in, interest is informs of
+  // /some-prefix/topology-independent-name
+  // currently /topology-independent-name must begin with /action or /file
+  // so that ContentServer knows where to look for the content object
+  void registerPrefix(const Ccnx::Name &prefix);
+  void deregisterPrefix(const Ccnx::Name &prefix);
+
+  void
+  serve(const Ccnx::Name &interest);
+
+private:
+  Ccnx::CcnxWrapperPtr m_ccnx;
+  ActionLogPtr m_actionLog;
+  typedef boost::shared_mutex Mutex;
+  typedef boost::unique_lock<Mutex> WriteLock;
+  typedef boost::shared_lock<Mutex> ReadLock;
+  typedef std::set<Ccnx::Name>::iterator PrefixIt;
+  std::set<Ccnx::Name> m_prefixes;
+  Mutex m_mutex;
+  boost::filesystem::path m_dbFolder;
+};
+#endif // CONTENT_SERVER_H
diff --git a/src/dispatcher.cc b/src/dispatcher.cc
index bdcc469..d7e570a 100644
--- a/src/dispatcher.cc
+++ b/src/dispatcher.cc
@@ -37,13 +37,19 @@
            , m_objectManager(ccnx, rootDir)
            , m_localUserName(localUserName)
            , m_sharedFolder(sharedFolder)
+           , m_server(NULL)
 {
   m_syncLog = make_shared<SyncLog>(path, localUserName);
   m_actionLog = make_shared<ActionLog>(m_ccnx, path, m_syncLog, sharedFolder);
+  Name syncPrefix = Name(BROADCAST_DOMAIN)(sharedFolder);
 
-  Name syncPrefix(BROADCAST_DOMAIN + sharedFolder);
+  m_server = new ContentServer(m_ccnx, m_actionLog, rootDir);
+  m_server->registerPrefix(localPrefix);
+  m_server->registerPrefix(syncPrefix);
+
   m_core = new SyncCore (m_syncLog, localUserName, localPrefix, syncPrefix,
                          bind(&Dispatcher::syncStateChanged, this, _1), ccnx, scheduler);
+
 }
 
 Dispatcher::~Dispatcher()
@@ -53,6 +59,12 @@
     delete m_core;
     m_core = NULL;
   }
+
+  if (m_server != NULL)
+  {
+    delete m_server;
+    m_server = NULL;
+  }
 }
 
 void
@@ -115,8 +127,8 @@
           int seg_num;
           tie (hash, seg_num) = m_objectManager.localFileToObjects (absolutePath, m_localUserName);
 
-          time_t wtime = filesystem::last_write_time (absolutePath);
-          filesystem::file_status stat = filesystem::status (absolutePath);
+          time_t wtime = filesystem::last_write_time(absolutePath);
+          filesystem::file_status stat = filesystem::status(absolutePath);
           int mode = stat.permissions();
 
           m_actionLog->AddLocalActionUpdate (relativeFilePath.generic_string(), *hash, wtime, mode, seg_num);
diff --git a/src/dispatcher.h b/src/dispatcher.h
index 7c3220e..3ebf67e 100644
--- a/src/dispatcher.h
+++ b/src/dispatcher.h
@@ -28,6 +28,7 @@
 #include "executor.h"
 #include "object-db.h"
 #include "object-manager.h"
+#include "content-server.h"
 #include <boost/function.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/shared_ptr.hpp>
@@ -106,6 +107,7 @@
   // for every fetched segment of a file
   map<Ccnx::Name, ObjectDbPtr> m_objectDbMap;
   std::string m_sharedFolder;
+  ContentServer *m_server;
 };
 
 namespace Error
