implemented authentication endpoint