more api bug fixes