update api to solve error