Split new API calls into own function

And just use CORS, we are not in IE 9