[api] fix some of the issues in #796