Add CORS support on the WebAPI server side, and fix the port number issue in $resource.