added authentication and broke out into own file