Added serialize() method in familyTree