[api] rework on code structure