Correctly base url for ajax requests