ajax, localstorage functionality