update some logic.

make the API more like NSUserDefault.