I have use a Youtube API to upload a video and when it success and response, I set the local storage to store the video_id. And it works perfectly fine before I put the JS code to execute a create service.
Here is a snapshot.
A simple replacement for this maybe if the value of the local storage variable change, execute service.