added local storage and free db functions api