CORS error for server requests [SOLVED]

FYI for anyone following, you can find the solution discusses in the last few replies here: