Wouldn't it be clearer if you didn't match on a tuple and used guard clauses instead? For example
```
case books if format == "json" =>
case books if format == "html" =>
case Nil => NotFound```