split api into api and ipc