url in global scope

In several places url wasn't defined in the scope of the function calls and was overwriting my global url, which is used by NodeJS.

This solves that.