refactor packets
define api
Add wire definitions