Fix PING and add test for it. Add extra field 'type' to quickly distinquish wheter it's a code or action.