Refactor and add tests around REST api workloads
Merge branch 'master' into restapirefactor