Refactor client communication to use action:{"json": "message"} format