public static function fromUsername($username, ApiClient $apiClient = null)
    {
        if (is_null($apiClient)) {
            $apiClient = static::createApiClient();
        }

        $apiResult = $apiClient->uuidApi($username);

        $json = $apiResult;

        if (isset($json->error)) {
            throw new \RuntimeException('Mojang Error: '.$json->errorMessage);
        }

        if (empty($json) || !isset($json[0]->id)) {
            throw new \RuntimeException('Invalid Username ('.$username.')');
        }
        static::rateLimitBust();

        return static::fromUuid($json[0]->id);
    }