Merging @bewest's wip/api-modules work