Fix authentication api. Fully works.