User authentication enpdoint implemented, refactoring