Finished the server side cross domain function