updated api a bit