save object by id