refactored create/update functions, added test cases
documentation updates