[api] properly parse logs.