26d00213ce83ce3458bf36149f3e95c90f8837c4
diff --git a/views/theme/views-views-json-style-exhibit.tpl.php b/views/theme/views-views-json-style-exhibit.tpl.php
index 5381463..0d26c07 100644
--- a/views/theme/views-views-json-style-exhibit.tpl.php
+++ b/views/theme/views-views-json-style-exhibit.tpl.php
@@ -7,9 +7,10 @@
  * - $view: The View object.
  * - $rows: Hierachial array of key=>value pairs to convert to JSON
  * - $options: Array of options for this style
- *
  * @ingroup views_templates
  */
+$types = '';
+$props = '';
 
 $jsonp_prefix = $options['jsonp_prefix'];
 
@@ -20,8 +21,9 @@ if ($view->override_path) {
   print "<code>$json</code>";
 }
 else {
-  $json = json_encode($rows);
+  $json = json_encode(exhibit_json(array_values($rows), $types, $props));
   if ($jsonp_prefix) $json = "$jsonp_prefix($json)";
+
   if ($options['using_views_api_mode']) {
     // We're in Views API mode.
     print $json;
@@ -30,9 +32,9 @@ else {
     // We want to send the JSON as a server response so switch the content
     // type and stop further processing of the page.
     $content_type = ($options['content_type'] == 'default') ? 'application/json' : $options['content_type'];
-    drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header('Content-Type', $content_type . '; charset=utf-8');
     print $json;
-    //Don't think this is needed in .tpl.php files: module_invoke_all('exit');
+    
     exit;
   }
 }
diff --git a/views/theme/views_views_json_style.theme.inc b/views/theme/views_views_json_style.theme.inc
index f5103ba..7bc258a 100644
--- a/views/theme/views_views_json_style.theme.inc
+++ b/views/theme/views_views_json_style.theme.inc
@@ -22,8 +22,8 @@ function template_preprocess_views_views_json_style_simple(&$vars) {
   $top_child_object = $options["top_child_object"];
   $plaintext_output = $options["plaintext_output"];
   $objects = array();
+  
   foreach ($rows as $row) {
-
     $object = array();
     /* Convert the $rows into a hierachial key=>value array */
     foreach ($row as $field) {
@@ -77,49 +77,56 @@ function template_preprocess_views_views_json_style_exhibit(&$vars) {
   $plaintext_output = $options["plaintext_output"];
   $objects = array();
   foreach ($rows as $row) {
-    $object = array($top_child_object => array());
+    //$object = array($top_child_object => array());
+    $object = array();
+    if (!array_key_exists("type", $object)) $object['type'] = $top_child_object;
+    if (!array_key_exists("label", $object)) $object['label'] = 'node/' . $row['nid']->content ;
+    if (!array_key_exists("id", $object)) $object['id'] = 'node/' . $row['nid']->content;
+    
     /* Convert the $rows into a hierachial key=>value array */
     foreach ($row as $field) {
-      if ($options["field_output"] == "normal") {
-        if ($field->label)
-          $label = $plaintext_output ? strip_tags($field->label) : $field->label;
-        else {
+        if ($options["field_output"] == "normal") {
+          if ($field->label)
+            $label = $plaintext_output ? strip_tags($field->label) : $field->label;
+          else {
+            $label = $plaintext_output ? strip_tags($field->id) : $field->id;
+          }
+          if (!$field->is_multiple) {
+            $content = $plaintext_output ? strip_tags($field->content) : $field->content;
+          }
+          else {
+            $content = array();
+            foreach ($field->content as $n => $oc) $content[$n] = ($plaintext_output ? strip_tags($oc) : $oc);
+          }
+        }
+        elseif ($options["field_output"] == "raw") {
           $label = $plaintext_output ? strip_tags($field->id) : $field->id;
-        }
-        if (!$field->is_multiple) {
-          $content = $plaintext_output ? strip_tags($field->content) : $field->content;
-        }
-        else {
-          $content = array();
-          foreach ($field->content as $n => $oc) $content[$n] = ($plaintext_output ? strip_tags($oc) : $oc);
-        }
-      }
-      elseif ($options["field_output"] == "raw") {
-        $label = $plaintext_output ? strip_tags($field->id) : $field->id;
-        if (!$field->is_multiple) {
-          $content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
+          if (!$field->is_multiple) {
+            $content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
+          }
+          else {
+            $content = array();
+            foreach ($field->raw as $n => $oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
+          }
+        }
+        
+        $object[$label] = $content;
+        // check if user wants nested arrays
+        /*
+        if (strlen($top_child_object) != 0) {
+          $object[$top_child_object][$label] = $content;
         }
         else {
-          $content = array();
-          foreach ($field->raw as $n => $oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
-        }
-      }
-
-      // check if user wants nested arrays
-      if (strlen($top_child_object) != 0) {
-        $object[$top_child_object][$label] = $content;
-      }
-      else {
-        $object[$label] = $content;
-      }
+          $object['label'] = $content;
+        }*/
+      
     }
-    if (!array_key_exists("label", $object)) $object["label"] = "Item";
-    if (!array_key_exists("type", $object)) $object["type"] = $top_child_object;
     $objects[] = $object;
   }
 
   // check if user wants nested arrays
-  $vars["rows"] = strlen($root_object) != 0 ? array($root_object => $objects) : $objects;
+  $vars["rows"] = $objects;
+  
 }
 
 function template_preprocess_views_views_json_style_jqgrid(&$vars) {
diff --git a/views_json.module b/views_json.module
index 5d8448f..c78ce8d 100644
--- a/views_json.module
+++ b/views_json.module
@@ -165,6 +165,11 @@ function _views_json_render_fields($view, $row) {
       $object->is_multiple = $field_is_multiple;
       $rendered_fields[$id] = $object;
     }
+   
+    $rendered_fields['nid'] = new stdClass();
+    $rendered_fields['nid']->label = 'id';
+    $rendered_fields['nid']->content = $row->nid;
+    $rendered_fields['nid']->is_multiple = FALSE;
   }
   return $rendered_fields;
 }
