[Added compatibility with different api roots -- works on winark]