fix assistant api bugs