Api authorisation

Closes #63 
Oh and lol: 418 "i'm a teapot"