more efficient case iteration, and api cleanup

- cloudcare api shouldn't include case history
- remove some api functions and funnel everything through the helpers
- update tests