Update test code using new api