class AnomalyController {

    @PostMapping(path = "/anomalies", consumes = "application/json", produces = "application/json")
    public List<OutlierDetectorResult> getAnomalies(@RequestBody AnomalyRequest request) {
        List<OutlierDetectorResult> detectorResults = anomalyRepository.getAnomalies(request);
        if (detectorResults == null || detectorResults.isEmpty()) {
            // TODO: This should be RecordNotFoundException
            throw new IllegalArgumentException("Invalid request: " + request);
        }
        return detectorResults;
    }

}