fix the OPTIONS error and jQuery parse ajax error

I am not sure whether this is correct, but it solve my problem. Later I simply do the fake using 
https://gist.github.com/20a49057495edbbf7509

So that no server side is needed.