Some cleanup in the api module.