Adding validateAuthN middleware