[api] move more webui logic to use API models