BS-11081, move the check of api inside the rest authorization filter