Minor refactorings to load in associated data for the API