Refactored out rest_interface