Made code testing friendly for login

Doesn't require login to work if no db is loaded