[python] Fixed api bug