moved from BasicAuth to SessionAuth
catch potential db errors
Merge pull request #2 from cryptix/master

Moved from BasicAuth to SessionAuth. Thanks @cryptix!