   CREATE or REPLACE FUNCTION 
   json_add_to_set(data json, key text, value json) RETURNS JSON AS $$
 
-    var data = JSON.parse(data); 
-    var value = JSON.parse(value); 
+    var data = data;
+    var value = value;
 
     var keys = key.split('.')
     var len = keys.length;

  CREATE or REPLACE FUNCTION 
  json_data(data json, fields text) RETURNS JSON AS $$

      var data = JSON.parse(data); 
  
      var _fields = fields.split(',');


  CREATE or REPLACE FUNCTION 
  json_string(data json, key text) RETURNS TEXT AS $$

    var ret = data;
    var keys = key.split('.')
    var len = keys.length;
    
