added database
Added login redirect so that unauthorized users can't access controllers that require login