sending back json responses from server