fixd some api bugs