def _prepare_response(retval)
      unless retval.is_a?(Hash)
        _error!(Errors::ServerError, "Invalid response: #{retval.inspect}")
      end

      JSON.dump(retval)
    end
def _prepare_response(retval)
      unless retval.is_a?(Hash)
        _error!(Errors::ServerError, "Invalid response: #{retval.inspect}")
      end

      JSON.dump(retval)
    end
Prepares the retval from a Service::Resource method to be returned to the
 client (i.e., validates it and dumps it as JSON).