add localStorage API, resolved #20