restructured to send serilized tree along with the entities