change API_HOST to window.location.hostname
merging with origin/master