anchor.diff:  join_xnest(XNestName) ->
   	{ok, XNestPid} = xnest_manager:get_xnest(XNestName),   %% I can know what format will be return by xnest_manager
   	{ok, JoinResult} = xnest:join(XNestPid, self()),
  -	xnest:input(XNestPid, {self(), text, JoinResult}),			%% Use xnest API to send join message
  +	xnest:input(XNestPid, {self(), text, {'join', JoinResult}}),			%% Use xnest API to send join message
   	{ok, XNestPid}.
   
   
   %% @doc generate response 
   -spec make_response(pid(), binary(), binary()) -> json().
  -make_response(FromPid, Xnest, Msg) ->
  +make_response(FromPid, Xnest, {Type, Msg}) ->
   	Time = time2binary(erlang:localtime()),
   	From = list_to_binary(pid_to_list(FromPid)),
  -	Msg_ = [ {<<"from">>, From}
  +	Frame = [ {<<"from">>, From}
   		,{<<"xnest">>, Xnest}
  +		,{<<"type">>, Type}
   		,{<<"payload">>, Msg}
   		,{<<"send_time">>, Time}
   	],
  -	Response = jsx:encode(Msg_),
  +	Response = jsx:encode(Frame),
   %lager:info("~p", [Response]),
   	Response.
   
  
positive.code: 		xnest_pid	= XNestPid
  	},
  	Req2 = cowboy_req:set_resp_header(<<"access-control-allow-origin">>, <<"*">>, Req1),
  	{ok, Req2, State }.
  
  
  
  
negative.code: 	XNestPid = State#state.xnest_pid,
  lager:warning("~p leave xnest ~p", [self(), XNestPid]),
  	Msg = <<"leave">>,
  	xnest:input(XNestPid, {self(), text, {'leave', Msg}}),			%% Use xnest API to send leave message
  	xnest:leave(XNestPid, self()),
  	ok.
  
  