diff --git a/dev/demo/matchdemo.js b/dev/demo/matchdemo.js
index 8f99e6c..185d28b 100644
--- a/dev/demo/matchdemo.js
+++ b/dev/demo/matchdemo.js
@@ -157,6 +157,11 @@
 	"</span>"+
 	"<span class=\"context-right\"></span>";
 
+  var meta = {"messages":[["Response format is temporary"]],"@context":"http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld","meta":{},"document":{"@type":"koral:document","fields":[{"@type":"koral:field","type":"type:store","key":"ref","value":"My reference"},{"@type":"koral:field","type":"type:text","key":"title","value":"Der Name der Rose"},{"@type":"koral:field","type":"type:string","key":"textSigle","value":"a/b/c"},{"@type":"koral:field","type":"type:string","key":"keyword","value":["baum","wald"]},{"@type":"koral:field","type":"type:number","key":"zahl1","value":56},{"@type":"koral:field","type":"type:string","key":"name","value":"Peter"}]}};
+
+  meta = {"messages":[["Response format is temporary"]],"@context":"http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld","meta":{},"document":{"@type":"koral:document","fields":[{"@type":"koral:field","type":"type:number","key":"pubDate","value":20170701},{"@type":"koral:field","type":"type:string","key":"textSigle","value":"WDD17/982/72848"},{"@type":"koral:field","type":"type:string","key":"foundries","value":"dereko dereko/structure dereko/structure/base-sentences-paragraphs-pagebreaks lwc lwc/dependency treetagger treetagger/morpho"},{"@type":"koral:field","type":"type:string","key":"corpusSigle","value":"WDD17"},{"@type":"koral:field","type":"type:string","key":"docSigle","value":"WDD17/982"},{"@type":"koral:field","type":"type:store","key":"reference","value":"Diskussion:99 Namen Allahs/Archiv/1, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:99_Namen_Allahs/Archiv/1: Wikipedia, 2017"},{"@type":"koral:field","type":"type:text","key":"author","value":"ArchivBot, u.a."},{"@type":"koral:field","type":"type:number","key":"creationDate","value":20140609},{"@type":"koral:field","type":"type:string","key":"textTypeArt","value":"Diskussion"},{"@type":"koral:field","type":"type:store","key":"editor","value":"wikipedia.org"},{"@type":"koral:field","type":"type:text","key":"title","value":"Diskussion:99 Namen Allahs/Archiv/1"},{"@type":"koral:field","type":"type:store","key":"tokenSource","value":"base#tokens"},{"@type":"koral:field","type":"type:store","key":"layerInfos","value":"dereko/s=spans lwc/d=rels tt/l=tokens tt/p=tokens"},{"@type":"koral:field","type":"type:string","key":"textClass","value":"staat-gesellschaft biographien-interviews"},{"@type":"koral:field","type":"type:string","key":"availability","value":"CC-BY-SA"}]}}
+
+  
 //  var treeSnippet = "<span class=\"context-left\"><\/span><span class=\"match\">In diesem <span title=\"cnx\/c:np\">Sinne<\/span> schrieb <span title=\"cnx\/c:np\">Brunschwicg<\/span>:&quot;In <span title=\"cnx\/c:np\">Euklids<\/span> <span title=\"cnx\/c:np\">Elementen<\/span> <span title=\"cnx\/c:np\">spiegel<\/span> sich die <span title=\"cnx\/c:np\">Resultate<\/span> der <span title=\"cnx\/c:np\">Arbeit von Generationen vor Aristoteles<\/span> wider, nicht nur die <span title=\"cnx\/c:np\">technische Arbeit<\/span> der <span title=\"cnx\/c:np\">Entdecklung<\/span>, sondern auch die <span title=\"cnx\/c:np\">methodologische Arbeit<\/span> der <span title=\"cnx\/c:np\">Verbindung<\/span> und des <span title=\"cnx\/c:np\">Beweises<\/span>, die, in der <span title=\"cnx\/c:np\">Schule<\/span> des <span title=\"cnx\/c:np\">Phythagoras<\/span> begonnen, ihre <span title=\"cnx\/c:np\">Vollendung in den Schulen von Eudoxos von Cnidus<\/span> und <span title=\"cnx\/c:np\">Platon<\/span> gefunden hat&quot;(5<\/span><span class=\"context-right\"><\/span>";
 
   KorAP.API.getMatchInfo = function(match, callObj, cb) {
@@ -173,4 +178,8 @@
       return cb({ "snippet": snippet });
     }
   };
+
+  KorAP.API.getTextInfo = function(doc, callObj, cb) {
+    return cb(meta);
+  };
 });
diff --git a/dev/js/src/api.js b/dev/js/src/api.js
index 89534be..b87eb1f 100644
--- a/dev/js/src/api.js
+++ b/dev/js/src/api.js
@@ -57,6 +57,25 @@
 
 
   /**
+   * Retrieve information about a document.
+   */
+  KorAP.API.getTextInfo = function (doc, param, cb) {
+
+    // doc is a KorAP.Match object
+    var url = KorAP.URL;
+    url += '/' + match.textSigle;
+
+    if (param['fields'] !== undefined) {
+      url += '?fields='; // TODO!
+    }
+    else {
+      url += '?fields=@all';
+    }
+    KorAP.API.getJSON(url, cb);
+  };
+
+
+  /**
    * Retrieve information about collections
    */
   KorAP.API.getCollections = function (cb) {
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index 63fa55a..bca7f09 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -190,19 +190,23 @@
       
       var ops = d.createElement('div');
       ops.classList.add('action', 'bottom', 'button-group');
-      
+
+      /*
+        Temporarily disabled
       var meta = ops.addE('span');
       meta.addT('Meta');
       meta.setAttribute('title', loc.SHOW_META);
       meta.classList.add('meta');
+      */
 
+      // TODO: Rename anno
       var info = ops.addE('span');
-      info.addT('Anno');
+      info.addT(loc.SHOWINFO);
       info.setAttribute('title', loc.SHOWINFO);
       info.classList.add('info');
 
       var tree = ops.addE('span');
-      tree.addT('+ Tree');
+      tree.addT(loc.ADDTREE);
       tree.setAttribute('title', loc.ADDTREE);
       tree.classList.add('tree');
 
@@ -213,12 +217,14 @@
       );
 
       // Click on meta - add meta (unless already there)
+      /*
       meta.addEventListener(
         'click', function (e) {
           e.halt();
           that.info().showMeta();
         }
       );
+      */
 
       // Click on token annotations - add token annotations (unless already there)
       info.addEventListener(
diff --git a/dev/js/src/match/info.js b/dev/js/src/match/info.js
index a72b66f..ba7214e 100644
--- a/dev/js/src/match/info.js
+++ b/dev/js/src/match/info.js
@@ -141,8 +141,35 @@
     },
 
 
-    getMetaData : function (metaInfo, cb) {
-      // ...
+    getMetaData : function (cb) {
+      KorAP.API.getTextInfo(
+        this._match, {}, function (textResponse) {
+          
+          if (textResponse === undefined) {
+            cb(null);
+            return;
+          };
+
+          var doc = textResponse["document"];
+       
+
+          if (doc === undefined) {
+            cb(null);
+            return;
+          };
+
+          var fields = doc["fields"];
+          if (fields === undefined) {
+            cb(null);
+            return;
+          };
+
+          // Add metainfo to matchview
+          cb(matchMetaClass.create(
+            this._match, fields
+          ));
+        }
+      );
     },
     
 
@@ -160,6 +187,11 @@
           'layer' : layer
         },
         function (matchResponse) {
+          if (matchResponse === undefined) {
+            cb(null);
+            return;
+          };
+
           // Get snippet from match info
           if (matchResponse["snippet"] !== undefined) {
             // Todo: This should be cached somehow
@@ -284,33 +316,29 @@
       metaTable.classList.add('metatable', 'loading');
       this.element().appendChild(metaTable);
 
-      // TODO: This is part of the getMeta!
+      /*
+       * This was temporary
       var metaInfo = this._match.element().getAttribute('data-info');
-
       if (metaInfo)
         metaInfo = JSON.parse(metaInfo);
-
+      */
       var that = this;
 
-      // There is metainfo
-      if (metaInfo) {
-
+      this.getMetaData(function (meta) {
         // Load data
         metaTable.classList.remove('loading');
 
-        // Add metainfo to matchview
-        var metaElem = matchMetaClass.create(this._match).element(metaInfo);
-        metaTable.appendChild(metaElem);
+        metaTable.appendChild(meta.element());
 
         // Add button
-        this._addButton('close', metaTable, function (e) {
+        that._addButton('close', metaTable, function (e) {
           this.parentNode.removeChild(this);
           that._visibleMeta = false;
           e.halt();
         });
-      };
+      });
 
-      // Load data
+      // Do not load any longer
       metaTable.classList.remove('loading');
     },
 
diff --git a/dev/js/src/match/meta.js b/dev/js/src/match/meta.js
index 8237935..05e1f3b 100644
--- a/dev/js/src/match/meta.js
+++ b/dev/js/src/match/meta.js
@@ -27,23 +27,24 @@
 
   // Localization values
   const loc   = KorAP.Locale;
-  loc.METADATA   = loc.METADATA   || 'Metadata';
+  loc.METADATA = loc.METADATA || 'Metadata';
 
   return {
 
     /**
      * Create new match object
      */
-    create : function (match) {
-      return Object.create(this)._init(match);
+    create : function (match, fields) {
+      return Object.create(this)._init(match, fields);
     },
 
     /**
      * Initialize object
      */
-    _init : function (match) {
+    _init : function (match, fields) {
       this._match = match;
-      this.opened = false;
+      this._fields = fields;
+      // this.opened = false;
       return this;
     },
 
@@ -57,26 +58,35 @@
     /**
      * Create match reference view.
      */
-    element : function (metaInfo) {
+    element : function () {
       if (this._element !== undefined)
         return this._element;
-      
-      /*
-      var header = metaTable.appendChild(
-        document.createElement('h6')
-      );
 
-      header.appendChild(
-        document.createElement('div')
-      ).appendChild(
-        document.createTextNode(loc.METADATA)
-      );
-      */
+      if (this._fields === null)
+        return;
 
       var metaDL = document.createElement('dl');
 
       this._element = metaDL;
 
+      var fields = this._fields;
+
+      // TODO:
+      // This should only remember array positions by index
+      // and keep all other field information intact
+      var metaInfo = {};
+      for (var i in fields) {
+        var value = fields[i].value;
+        if (value instanceof Array) {
+          metaInfo[fields[i].key] = value.join(", ");
+        }
+        else {
+          metaInfo[fields[i].key] = value;
+        };
+      };
+
+      // console.log(fields);
+
       // TODO: Meta fields should be separated
       var keys = Object.keys(metaInfo);
       for (var i in keys.sort()) {
