Prove not a violation of Stokes theorem The question is as follows:

Define the vector field ${\bf F}$ on the complement of the $z$-axis by
  $${\bf F}(x,y,z)= \frac{-y{\bf i} +x{\bf j}}{x^{2}+y^{2}}.$$
i) Show that $\operatorname{curl}({\bf F}) = 0$.

We have
$$(0-0){\bf i} + (0-0){\bf j} + \left((x^{2}+y^{2})^{-1} -2x^{2}(x^{2}+y^{2})^{-2} + (x^{2}+y^{2})^{-1} -2y^{2}(x^{2}+y^{2})^{-2}\right) {\bf k}.$$
Collecting terms we have $0{\bf i} +0{\bf j}+0{\bf k}$. Thus $\operatorname{curl} ({\bf F})=0$.

ii) Show by direct calculation $\displaystyle \oint_{C} {\bf F} \cdot {\bf dx} =2\pi$ for any horizontal circle $C$ centered at a point on the $z$-axis.

I can't even figure this out...
The main part of the question is even though i and ii are true why doesn't this contradict Stokes' theorem?
 A: Another hint: Why do we know that if a vector field has zero curl, the integral around every closed loop is zero? Because Stokes' Theorem tells us that
$$\oint_{\partial S} \vec{F}\cdot d\vec{r} = \iint_S (\nabla \times \vec{F})\cdot d\vec{S}
$$
And if $\nabla \times \vec{F} = 0$, then both integrals are zero. But note something: If we have a closed curve $C$, for Stokes' Theorem to apply, we need to use a surface which has $C$ has its border and integrate $\nabla \times \vec{F}$ on that surface. But in this particular case, no matter what surface you pick, there will be a problem. Can you figure out what that is?
Full answer: The problem is that no matter what surface you pick such that its border is a circle centered at the $z$ axis, there will be a point where your function is not defined. This is because any such surface has to cross the $z$ axis, and $\vec{F}$ is defined at precisely those points that are not on the $z$ axis. Stokes' theorem requires that we have a regular surface and a vector field defined on it, but $\vec{F}$ doesn't satisfy this. Therefore, we can't apply the theorem is this situation, so there is no contradiction.
Further edit: About actually doing the line integral. If $C$ is a horizontal (this means parallel to the $xy$ plane) circle with its center at the $z$ axis, how to we parametrize it? $\sigma(t) = (\cos t, \sin t, 0)$ is the circle of radius $1$ at $z=0$, so we can just generalize it to $\sigma(t) = (R\cos t, R\sin t, h)$, where $R$ is the radius of the circle and $h$ its height above the $xy$ plane. Now let's do the integral as usual:
$$\vec{F} = (-\frac{y}{x^2+y^2}, \frac{x}{x^2+y^2}, 0)$$
$$\sigma(t) = (R\cos t, R\sin t, h),\ 0 \le t \le 2\pi$$
$$\sigma'(t) = (-R\sin t, R\cos t, 0)$$
$$\vec{F}(\sigma(t)) = (-\frac1R \sin t, \frac1R \cos t, 0)$$
$$\vec{F}(\sigma(t))\cdot \sigma'(t) = 1$$
So we have
$$\oint_C \vec{F}\cdot d \vec{r} = \int_0^{2\pi} \vec{F}(\sigma(t))\cdot \sigma'(t) \ dt = \int_0^{2\pi} 1\ dt = 2\pi$$
