def validate_incoming_request
      unless request.media_type == Rack::Mime.mime_type('.json')
        error_msg = ServiceError.new(ServiceError::INVALID_CONTENT).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, request media type: #{request.media_type} is not json")
        abort_request(error_msg)
      end
      unless auth_token && (auth_token == @token)
        error_msg = ServiceError.new(ServiceError::NOT_AUTHORIZED).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, expected token: #{@token}, specified token: #{auth_token}")
        abort_request(error_msg)
      end
      unless @handle_fetched
        error_msg = ServiceError.new(ServiceError::SERVICE_UNAVAILABLE).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, handles not fetched")
        abort_request(error_msg)
      end
    end
def validate_incoming_request
      unless request.media_type == Rack::Mime.mime_type('.json')
        error_msg = ServiceError.new(ServiceError::INVALID_CONTENT).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, request media type: #{request.media_type} is not json")
        abort_request(error_msg)
      end
      unless auth_token && (auth_token == @token)
        error_msg = ServiceError.new(ServiceError::NOT_AUTHORIZED).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, expected token: #{@token}, specified token: #{auth_token}")
        abort_request(error_msg)
      end
      unless @handle_fetched
        error_msg = ServiceError.new(ServiceError::SERVICE_UNAVAILABLE).to_hash
        logger.error("Validation failure: #{error_msg.inspect}, handles not fetched")
        abort_request(error_msg)
      end
    end
Validate the incoming request