anchor.diff:  	Streams = lists:map(fun(A) -> lib_json:to_string(A) end, lib_json:get_field(Trigger, "streams")),
   	VStreams = lists:map(fun(A) -> lib_json:to_string(A) end, lib_json:get_field(Trigger, "vstreams")),
   	InputList = parse_outputlist(lib_json:get_field(Trigger, "outputlist"),[]),
  -	Type = lib_json:get_field(Trigger, "type"),
  +	Type = lib_json:to_string(lib_json:get_field(Trigger, "type")),
   	NewElement = {{id,Id},{function,Function},{inputlist,InputList},{streams,Streams},{vstreams,VStreams},{type,Type}},
   	parse_triggers(Rest,[NewElement|Acc]).
   
  
positive.code: 		    ErrorString = api_help:generate_error(Body, Code),
  		    {{halt, Code} = wrq:set_resp_body(ErrorString, ReqData), State};
  		{ok, JsonStruct} ->
  		    TriggerList = lib_json:get_field(JsonStruct, "_source.triggers"),			       
  		    case {proplists:get_value('streamid', wrq:path_info(ReqData)),proplists:get_value('vstreamid', wrq:path_info(ReqData))} of
  				{undefined,undefined} ->			    
  					{lib_json:set_attr(triggers, TriggerList),ReqData, State};
  
negative.code: 					UserUpdate = lib_json:set_attrs([{"script",list_to_binary("ctx._source.triggers += newelement")},
  													 {"params","{}"},{"params.newelement","{}"},
  													 {"params.newelement.function",list_to_binary(Function)}, {"params.newelement.input",Input},
  													 {"params.newelement.streams",Streams},{"params.newelement.vstreams",VirtualStreams},
  													 {"params.newelement.output_type",list_to_binary("uri")},{"params.newelement.output_id",list_to_binary(URI)}]),
  					case api_help:update_doc(?INDEX, "user", User, UserUpdate) of
  						{error, {UPCode, UPBody}} -> 
  