use the generic _write function in localstorage.write()
fix localstoragetests to work with refactored http-api