Wrap authentication functions in service