Factored everything out of API object classes.