REfactoring api module back into toplevel API class