API update (extensive)

* Made API more dynamic
* Added look-up helpers for type -> type identifier
* Added new endpoint handling
* Added new location handling
* Added custom error classes
* Logging & formatting fixes
* Code clean-up