Add write APIs and perform refactoring
Merge pull request #11 from RoxasShadow/master

Add write APIs and perform refactoring