diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index c603f6d..2706d8c 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -774,6 +774,68 @@
     };
 
 
+    public Text getDoc (String uid) {
+        // This is very similar to getMatchInfo
+
+        Text text = new Text();
+
+        Filter filter = (Filter) new QueryWrapperFilter(new TermQuery(new Term("UID", uid)));
+
+        try {
+
+            // Iterate over all atomic indices and find the matching document
+            for (LeafReaderContext atomic : this.reader().leaves()) {
+
+                // Retrieve the single document of interest
+                DocIdSet filterSet = filter.getDocIdSet(atomic, atomic.reader()
+                                                        .getLiveDocs());
+
+                // Create a bitset for the correct document
+                Bits bitset = filterSet.bits();
+
+                DocIdSetIterator filterIterator = filterSet.iterator();
+
+                if (DEBUG)
+                    log.trace("Checking document in {} with {}", filterSet,
+                            bitset);
+
+                // No document found
+                if (filterIterator == null)
+                    continue;
+
+                // Go to the matching doc - and remember its ID
+                int localDocID = filterIterator.nextDoc();
+
+                if (localDocID == DocIdSetIterator.NO_MORE_DOCS)
+                    continue;
+
+                // We've found the correct document! Hurray!
+                if (DEBUG)
+                    log.trace("We've found a matching document");
+
+                // HashSet<String> fields = (HashSet<String>) new Krill()
+                //    .getMeta().getFields().clone();
+                // fields.add(field);
+
+                // Load the necessary fields of the document
+
+                // TODO: Probably use
+                // document(int docID, StoredFieldVisitor visitor)
+                Document doc = atomic.reader().document(localDocID);
+                text.populateFields(doc);
+
+                return text;
+            };
+        }
+        catch (IOException e) {
+            text.addError(600, "Unable to read index", e.getLocalizedMessage());
+            log.warn(e.getLocalizedMessage());
+        };
+
+        text.addError(830, "Filter was empty");
+
+        return text;
+    };
 
     public String getMatchIDWithContext (String id) {
         /* No includeHighlights */
diff --git a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
index 2d3053b..e7712c8 100644
--- a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
+++ b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
@@ -6,6 +6,9 @@
 import de.ids_mannheim.korap.index.FieldDocument;
 import de.ids_mannheim.korap.response.Response;
 
+import org.apache.lucene.document.Document;
+import org.apache.lucene.index.IndexableField;
+
 import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -72,6 +75,151 @@
             // Meta information regarding annotations
             tokenSource, layerInfos;
 
+    /**
+     * Populate document meta information with information coming from
+     * the index.
+     * 
+     * @param doc
+     *            Document object.
+     * @param field
+     *            Primary data field.
+     */
+    public void populateDocument (Document doc, String field) {
+        HashSet<String> fieldList = new HashSet<>(32);
+        Iterator<IndexableField> fieldIterator = doc.getFields().iterator();
+        while (fieldIterator.hasNext())
+            fieldList.add(fieldIterator.next().name());
+
+        this.populateDocument(doc, field, fieldList);
+    };
+
+    public void populateFields (Document doc) {
+
+        HashSet<String> fieldList = new HashSet<>(32);
+        Iterator<IndexableField> fieldIterator = doc.getFields().iterator();
+        while (fieldIterator.hasNext())
+            fieldList.add(fieldIterator.next().name());
+
+        this.populateFields(doc, fieldList);
+    };
+
+    public void populateFields (Document doc, Collection<String> fields) {
+
+        // Remember - never serialize "tokens"
+
+        // LEGACY
+        if (fields.contains("corpusID"))
+            this.setCorpusID(doc.get("corpusID"));
+        if (fields.contains("ID"))
+            this.setID(doc.get("ID"));
+        if (fields.contains("tokenization"))
+            this.setTokenization(doc.get("tokenization"));
+        if (fields.contains("layerInfo"))
+            this.setLayerInfo(doc.get("layerInfo"));
+
+        // valid
+        if (fields.contains("UID"))
+            this.setUID(doc.get("UID"));
+        if (fields.contains("author"))
+            this.setAuthor(doc.get("author"));
+        if (fields.contains("textClass"))
+            this.setTextClass(doc.get("textClass"));
+        if (fields.contains("title"))
+            this.setTitle(doc.get("title"));
+        if (fields.contains("subTitle"))
+            this.setSubTitle(doc.get("subTitle"));
+        if (fields.contains("pubDate"))
+            this.setPubDate(doc.get("pubDate"));
+        if (fields.contains("pubPlace"))
+            this.setPubPlace(doc.get("pubPlace"));
+
+        // Temporary (later meta fields in term vector)
+        if (fields.contains("foundries"))
+            this.setFoundries(doc.get("foundries"));
+
+        // New fields
+        if (fields.contains("textSigle"))
+            this.setTextSigle(doc.get("textSigle"));
+        if (fields.contains("docSigle"))
+            this.setDocSigle(doc.get("docSigle"));
+        if (fields.contains("corpusSigle"))
+            this.setCorpusSigle(doc.get("corpusSigle"));
+        if (fields.contains("layerInfos"))
+            this.setLayerInfos(doc.get("layerInfos"));
+        if (fields.contains("tokenSource"))
+            this.setTokenSource(doc.get("tokenSource"));
+        if (fields.contains("editor"))
+            this.setEditor(doc.get("editor"));
+
+        if (fields.contains("corpusAuthor"))
+            this.setCorpusAuthor(doc.get("corpusAuthor"));
+        if (fields.contains("corpusEditor"))
+            this.setCorpusEditor(doc.get("corpusEditor"));
+        if (fields.contains("corpusTitle"))
+            this.setCorpusTitle(doc.get("corpusTitle"));
+        if (fields.contains("corpusSubTitle"))
+            this.setCorpusSubTitle(doc.get("corpusSubTitle"));
+
+        if (fields.contains("docAuthor"))
+            this.setDocAuthor(doc.get("docAuthor"));
+        if (fields.contains("docEditor"))
+            this.setDocEditor(doc.get("docEditor"));
+        if (fields.contains("docTitle"))
+            this.setDocTitle(doc.get("docTitle"));
+        if (fields.contains("docSubTitle"))
+            this.setDocSubTitle(doc.get("docSubTitle"));
+
+        if (fields.contains("publisher"))
+            this.setPublisher(doc.get("publisher"));
+        if (fields.contains("reference"))
+            this.setReference(doc.get("reference"));
+        if (fields.contains("creationDate"))
+            this.setCreationDate(doc.get("creationDate"));
+        if (fields.contains("keywords"))
+            this.setKeywords(doc.get("keywords"));
+        if (fields.contains("textClass"))
+            this.setTextClass(doc.get("textClass"));
+        if (fields.contains("textColumn"))
+            this.setTextColumn(doc.get("textColumn"));
+        if (fields.contains("textDomain"))
+            this.setTextDomain(doc.get("textDomain"));
+        if (fields.contains("textType"))
+            this.setTextType(doc.get("textType"));
+        if (fields.contains("textTypeArt"))
+            this.setTextTypeArt(doc.get("textTypeArt"));
+        if (fields.contains("textTypeRef"))
+            this.setTextTypeRef(doc.get("textTypeRef"));
+        if (fields.contains("language"))
+            this.setLanguage(doc.get("language"));
+        if (fields.contains("license"))
+            this.setLicense(doc.get("license"));
+        if (fields.contains("pages"))
+            this.setPages(doc.get("pages"));
+
+        if (fields.contains("biblEditionStatement"))
+            this.setBiblEditionStatement(doc.get("biblEditionStatement"));
+        if (fields.contains("fileEditionStatement"))
+            this.setFileEditionStatement(doc.get("fileEditionStatement"));
+    };
+
+    /**
+     * Populate document meta information with information coming from
+     * the index.
+     * 
+     * @param doc
+     *            Document object.
+     * @param field
+     *            Primary data field.
+     * @param fields
+     *            Hash object with all supported fields.
+     */
+    public void populateDocument (Document doc, String field,
+            Collection<String> fields) {
+        this.setField(field);
+        this.setPrimaryData(doc.get(field));
+        this.populateFields(doc, fields);
+    };
+
 
     /**
      * Get the publication date of the document
diff --git a/src/main/java/de/ids_mannheim/korap/response/Match.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
index 47806af..a3aeee7 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -4,14 +4,12 @@
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import org.apache.lucene.document.Document;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermContext;
 import org.apache.lucene.search.spans.Spans;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.FixedBitSet;
-import org.apache.lucene.index.IndexableField;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -46,7 +44,7 @@
 
 /**
  * Representation of Matches in a Result.
- * <strong>Warning:</strong> This is currently highliy dependent
+ * <strong>Warning:</strong> This is currently highly dependent
  * on DeReKo data and will change in the future.
  * 
  * @author Nils Diewald
@@ -392,139 +390,6 @@
 
 
     /**
-     * Populate document meta information with information coming from
-     * the index.
-     * 
-     * @param doc
-     *            Document object.
-     * @param field
-     *            Primary data field.
-     */
-    public void populateDocument (Document doc, String field) {
-        HashSet<String> fieldList = new HashSet<>(32);
-        Iterator<IndexableField> fieldIterator = doc.getFields().iterator();
-        while (fieldIterator.hasNext())
-            fieldList.add(fieldIterator.next().name());
-
-        this.populateDocument(doc, field, fieldList);
-    };
-
-
-    /**
-     * Populate document meta information with information coming from
-     * the index.
-     * 
-     * @param doc
-     *            Document object.
-     * @param field
-     *            Primary data field.
-     * @param fields
-     *            Hash object with all supported fields.
-     */
-    public void populateDocument (Document doc, String field,
-            Collection<String> fields) {
-        this.setField(field);
-        this.setPrimaryData(doc.get(field));
-
-        // Remember - never serialize "tokens"
-
-        // LEGACY
-        if (fields.contains("corpusID"))
-            this.setCorpusID(doc.get("corpusID"));
-        if (fields.contains("ID"))
-            this.setDocID(doc.get("ID"));
-        if (fields.contains("tokenization"))
-            this.setTokenization(doc.get("tokenization"));
-        if (fields.contains("layerInfo"))
-            this.setLayerInfo(doc.get("layerInfo"));
-
-        // valid
-        if (fields.contains("UID"))
-            this.setUID(doc.get("UID"));
-        if (fields.contains("author"))
-            this.setAuthor(doc.get("author"));
-        if (fields.contains("textClass"))
-            this.setTextClass(doc.get("textClass"));
-        if (fields.contains("title"))
-            this.setTitle(doc.get("title"));
-        if (fields.contains("subTitle"))
-            this.setSubTitle(doc.get("subTitle"));
-        if (fields.contains("pubDate"))
-            this.setPubDate(doc.get("pubDate"));
-        if (fields.contains("pubPlace"))
-            this.setPubPlace(doc.get("pubPlace"));
-
-        // Temporary (later meta fields in term vector)
-        if (fields.contains("foundries"))
-            this.setFoundries(doc.get("foundries"));
-
-        // New fields
-        if (fields.contains("textSigle"))
-            this.setTextSigle(doc.get("textSigle"));
-        if (fields.contains("docSigle"))
-            this.setDocSigle(doc.get("docSigle"));
-        if (fields.contains("corpusSigle"))
-            this.setCorpusSigle(doc.get("corpusSigle"));
-        if (fields.contains("layerInfos"))
-            this.setLayerInfos(doc.get("layerInfos"));
-        if (fields.contains("tokenSource"))
-            this.setTokenSource(doc.get("tokenSource"));
-        if (fields.contains("editor"))
-            this.setEditor(doc.get("editor"));
-
-        if (fields.contains("corpusAuthor"))
-            this.setCorpusAuthor(doc.get("corpusAuthor"));
-        if (fields.contains("corpusEditor"))
-            this.setCorpusEditor(doc.get("corpusEditor"));
-        if (fields.contains("corpusTitle"))
-            this.setCorpusTitle(doc.get("corpusTitle"));
-        if (fields.contains("corpusSubTitle"))
-            this.setCorpusSubTitle(doc.get("corpusSubTitle"));
-
-        if (fields.contains("docAuthor"))
-            this.setDocAuthor(doc.get("docAuthor"));
-        if (fields.contains("docEditor"))
-            this.setDocEditor(doc.get("docEditor"));
-        if (fields.contains("docTitle"))
-            this.setDocTitle(doc.get("docTitle"));
-        if (fields.contains("docSubTitle"))
-            this.setDocSubTitle(doc.get("docSubTitle"));
-
-        if (fields.contains("publisher"))
-            this.setPublisher(doc.get("publisher"));
-        if (fields.contains("reference"))
-            this.setReference(doc.get("reference"));
-        if (fields.contains("creationDate"))
-            this.setCreationDate(doc.get("creationDate"));
-        if (fields.contains("keywords"))
-            this.setKeywords(doc.get("keywords"));
-        if (fields.contains("textClass"))
-            this.setTextClass(doc.get("textClass"));
-        if (fields.contains("textColumn"))
-            this.setTextColumn(doc.get("textColumn"));
-        if (fields.contains("textDomain"))
-            this.setTextDomain(doc.get("textDomain"));
-        if (fields.contains("textType"))
-            this.setTextType(doc.get("textType"));
-        if (fields.contains("textTypeArt"))
-            this.setTextTypeArt(doc.get("textTypeArt"));
-        if (fields.contains("textTypeRef"))
-            this.setTextTypeRef(doc.get("textTypeRef"));
-        if (fields.contains("language"))
-            this.setLanguage(doc.get("language"));
-        if (fields.contains("license"))
-            this.setLicense(doc.get("license"));
-        if (fields.contains("pages"))
-            this.setPages(doc.get("pages"));
-
-        if (fields.contains("biblEditionStatement"))
-            this.setBiblEditionStatement(doc.get("biblEditionStatement"));
-        if (fields.contains("fileEditionStatement"))
-            this.setFileEditionStatement(doc.get("fileEditionStatement"));
-    };
-
-
-    /**
      * Get document id.
      */
     @JsonProperty("docID")
diff --git a/src/main/java/de/ids_mannheim/korap/response/Text.java b/src/main/java/de/ids_mannheim/korap/response/Text.java
new file mode 100644
index 0000000..437f24c
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/response/Text.java
@@ -0,0 +1,53 @@
+package de.ids_mannheim.korap.response;
+
+import java.util.*;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+import de.ids_mannheim.korap.index.AbstractDocument;
+
+/**
+ * Representation of Texts in a Result.
+ * <strong>Warning:</strong> This is currently highly dependent
+ * on DeReKo data and will change in the future.
+ * 
+ * @author Nils Diewald
+ * @see Result
+ */
+@JsonInclude(Include.NON_NULL)
+public class Text extends AbstractDocument {
+
+    // Logger
+    private final static Logger log = LoggerFactory.getLogger(Text.class);
+
+    // This advices the java compiler to ignore all loggings
+    public static final boolean DEBUG = false;
+
+    // Mapper for JSON serialization
+    ObjectMapper mapper = new ObjectMapper();
+
+    public Text () {};
+
+    public String toJsonString () {
+        JsonNode json = (JsonNode) this.toJsonNode();
+
+        // Match was no match
+        if (json.size() == 0)
+            return "{}";
+        try {
+            return mapper.writeValueAsString(json);
+        }
+        catch (Exception e) {
+            log.warn(e.getLocalizedMessage());
+        };
+
+        return "{}";
+    };
+};
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 7e03f21..b46d82c 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,4 +1,4 @@
-# log4j.rootLogger = ERROR, stdout
+log4j.rootLogger = ERROR, stdout
 
 # Queries:
 # log4j.logger.de.ids_mannheim.korap.query.SpanNextQuery = TRACE, stdout
@@ -17,6 +17,8 @@
 # log4j.logger.de.ids_mannheim.korap.query.spans.FocusSpans = TRACE, stdout
 # log4j.logger.de.ids_mannheim.korap.query.spans.MatchSpans = TRACE, stdout
 
+org.glassfish.grizzly.http.server.NetworkListener = TRACE, stdout
+
 # Wrappers:
 # log4j.logger.de.ids_mannheim.korap.KrillQuery = TRACE, stdout
 # log4j.logger.de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper = TRACE, stdout
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
index 653549a..15079c2 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
@@ -106,4 +106,20 @@
 
         // hasDeletions, hasPendingMerges
     };
+
+    @Test
+    public void indexFieldInfo () throws IOException {
+        KrillIndex ki = new KrillIndex();
+
+        FieldDocument fd = new FieldDocument();
+        fd.setTitle("Peter");
+        fd.setUID(22);
+        ki.addDoc(fd);
+        ki.commit();
+
+        assertEquals(1, ki.numberOf("base", "documents"));
+
+        assertEquals("Peter", ki.getDoc("22").getTitle());
+        assertEquals(22, ki.getDoc("22").getUID());
+    };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/server/TestResource.java b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
index 2f1c128..3181245 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -76,15 +76,9 @@
         Node.closeDBPool();
         t4 = System.nanoTime();
 
-        double startup = (double) (t2 - t1) / 1000000000.0;
-        double action = (double) (t3 - t2) / 1000000000.0;
+        double startup  = (double) (t2 - t1) / 1000000000.0;
+        double action   = (double) (t3 - t2) / 1000000000.0;
         double shutdown = (double) (t4 - t3) / 1000000000.0;
-
-        /*
-        System.err.println("Startup:  " + startup + ", " +
-                           "Action:   " + action  + ", " +
-                           "Shutdown: " + shutdown);
-        */
     };
 
 
@@ -129,6 +123,7 @@
 
                 res = mapper.readTree(resp);
                 assertEquals("milena", res.at("/meta/node").asText());
+                assertEquals(681, res.at("/messages/0/0").asInt());
             }
             catch (Exception e) {
                 fail("Server response failed " + e.getMessage()
@@ -150,6 +145,7 @@
             // Check mirroring
             assertEquals(2439, res.at("/text/UID").asInt());
             assertEquals("milena", res.at("/meta/node").asText());
+            assertEquals(681, res.at("/messages/0/0").asInt());
         }
         catch (Exception e) {
             fail("Server response failed " + e.getMessage() + " (Known issue)");
@@ -160,9 +156,18 @@
                 .post(Entity.text(""), String.class);
         res = mapper.readTree(resp);
         assertEquals("milena", res.at("/meta/node").asText());
+
+        // Staged data committed
         assertEquals(683, res.at("/messages/0/0").asInt());
     };
 
+    /*
+    @Test
+    public void testRemoving () throws IOException {
+                resp = target.path("/index/" + i).request("application/json")
+                        .put(jsonE, String.class);
+    };
+    */
 
     @Test
     public void testCollection () throws IOException {
