fixed more api bugs