add create and update
implement save based on create and update
refactoring and cleanup