Updated service to handle local storage.