Seperated "library" functionality into a class. Added baseline API interface. Added Error view.
Fixed some issues with the migration of code, added output from api