Add tests for auth and apikey checks using stubbed out db calls

Signed-off-by: Geoff Lane <geoff@zorched.net>