tweak api url passing to javascript