I would break this into two functions: `findByPath` (accepts a string) and `findById` (accepts an int). Try to avoid using the `Any` type: at the moment it could fail unexpectedly at runtime if:
 - The id is `None`
 - The id is not of type `Option[Int]` or `String`

By using `Any` for this function the compile cannot verify that you're calling it in the correct way.