updated some stuff including the conversion between JSON and message object