Api authentication

Fixes #57