How to retrieve and search for cases