Rework API

Renames API classes, moves into separate files and reworks exceptions to be normal errors.