Some refactoring, splitting out controllers
Lots of refactoring. Linting too.
Added better validation. Authorisation is now better. Some refactoring