anchor.diff:      Bodys = [[{mqtt_client,  Tab},
   	     {clientId, ClientId}, 
   	     {ipaddress, list_to_binary(emqttd_net:ntoa(Ipaddr))}] || {Tab, ClientId, Ipaddr, _Password} <- Clients],
  -    JsonData = 
  -    if length(Bodys) == 0 ->
  -	<<"\[\]">>;
  -    true ->
  -        list_to_binary(mochijson2:encode(Bodys) ++ <<10>>)
  -    end,
  -    Req:respond({200, [{"Content-Type","application/json"}], JsonData});
  -
  +    api_respond(Req, Bodys);
  +    
   %%-----------------------------------session--------------------------------------
   %%sessin check api
   api(session, Req) ->
  
positive.code:     Bodys = [[{mqtt_subscriber,  Tab},
               {topic, Topic}, 
               {qos, Qos}] || {Tab, Topic, Qos, Pid} <- SubLists],
      JsonData = 
      if length(Bodys) == 0 ->
  	<<"\[\]">>;
  
negative.code: api(broker, Req) ->
      Funs = [sysdescr, version, uptime, datetime],
      BrokerInfo = [{Fun, list_to_binary(emqttd_broker:Fun())}|| Fun <- Funs],
      api_respond(Req, BrokerInfo);
     
  api(stats, Req) ->
      Stats = [{Stat, Val} || {Stat, Val} <- emqttd_stats:getstats()],
      api_respond(Req, Stats);
     
  api(ptype, Req) ->
      PortTyeps = emqttd_vm:get_port_types(), 
      api_respond(Req, PortTyeps);
     
  api(memory, Req) ->
      Memory = emqttd_vm:get_memory(), 
      api_respond(Req, Memory);
      
  api(cpu, Req) ->
      Cpu = emqttd_vm:loads(), 
      api_respond(Req, Cpu);
      
  api(metrics, Req) ->
      Metrics = [{Metric, Val} || {Metric, Val} <- emqttd_metrics:all()],
      api_respond(Req, Metrics);
     
  api(listeners, Req) ->
      Llists = [Listeners || {Listeners , _Port} <- esockd:listeners()],
      api_respond(Req, Llists);
      
  %%-----------------------------------clients--------------------------------------
  %%clients api
  api(clients, Req) ->
  