Added proper save and update logic . now the relation object json is not stored with main document but only as link with the relation name