Output is now called Api
WIP refactoring, stuff compiles but is probably all broken