updated api to match new schema