Rewrite communication system now based on json