Get the correct api url from php for the javascript