add write Apis and implementation, read still functional, write not tested
write now tested, and functional