added jsonification of server replies