resolve cross domain problem for javascript to call the API