cors fix, authentication check implementation