fixing urls + apiURL parameter in the js