finish message passing and json packaging