Add some exception classes and enums for the new API.