fix some peer api bugs