some api bug-fixes