Changes to use apiUrl for REST requests