private ModelType getModelTypeByUrl(String url) {
        if (url.contains(API_V1 + "/detection")) {
            return DETECTION;
        } else if (url.contains(API_V1 + "/verification")) {
            return VERIFY;
        } else if (url.contains(API_V1 + "/recognition")) {
            return RECOGNITION;
        }

        throw new IncorrectModelTypeException(url.substring(API_V1.length()));
    }
Filter created to validate if this application has access to requested model
java/api/src/main/java/com/exadel/frs/core/trainservice/filter/SecurityValidationFilter.java