validates localStorage api usage