fix some api code...