def valid_api_key?(api_key = nil)
      api_key ||= @api_key
      return false if api_key.empty?

      res = client.get("/api/#{@api_version}/user/#{api_key}/user-information")

      return false if !res.success? || res.body.has_key?("error")
      return true
    end
def valid_api_key?(api_key = nil)
      api_key ||= @api_key
      return false if api_key.empty?

      res = client.get("/api/#{@api_version}/user/#{api_key}/user-information")

      return false if !res.success? || res.body.has_key?("error")
      return true
    end
Initialize a client which will be used to communicate with WaniKani.

 @param options [Hash] the API key (required) and API version (optional)
   used to communicate with the WaniKani API.
 @return [Wanikani::Client] an instance of Wanikani::Client.
 Verifies if the client's API key is valid by checking WaniKani's API.

 @param api_key [String] the API key to validate in WaniKani.
 @return [Boolean] whether the API key is valid.