fix api function call error