[api] no need to trim nil