Reverting initial attempt to modularize API; see api-refactoring branch instead