Improve coverage for api module.