Move API exceptions to different module.