Fix fatal error when setting API key

No such property $url, updated to use constant