Authorization

Fixes #28 and #29