Fixes #182. Refactor REST services to not be so timing dependent.