change websocket API to remove the need for a special emit_action() function