Fixes error in documents API when the patients has no documents