way better JSON script detection

Now loops through childNodes array to find if API script URL is present;
if so, deletes and re-adds to refresh. If not, adds.