Fix Api.js issue

The Api relied on XMLHttpRequest objects to make upcalls to the "x-js-py" api
layer, while that layer was only listening for navigation requests.
Now Api.js uses document.location.assign(*) as documented on mdn:
https://developer.mozilla.org/en-US/docs/Web/API/Location.assign