refactored client side rest calls (WIP)