added packet api. added host api. rewrote sync to use new apis