add get_document_or_404 and have _get_case_or_404 call it

wanted this for something else and saw we sort of already had it