[api] minor code cleanup