[api] small code improvement