updating script to use variable root resource url (for dev/test/prod switching)