split the server and the client, handle cross domain requests in AJAX