Handling resource not found exception for findOptionalResource