Updated api to new interface