updated api sample