Add exception-based functions for the public API.