Wrap with top-level API.
Move api to separate file.