Finished reversion to REST API

A bit of janky work done here in reaction to changes made to ZAF.
Enough to make sure hopefully that everything will work now. Testing
this branch until I can be sure all previous issues have been fixed.