adding method in service to update an entity