Fix wrong api used