fixes some api bugs