Hi maxwell88 that is not so simple. you are going from a sync to async task. More thought needs to be put into it, you can't just go from one to the other. You need to add some more exception handlers, wait timers, possibly hide it in the background, and change your call outs. I highly recommend looking into how localstorage works in order to get a better handle on things.
In summary, you can't just switch. There is more too it than that.