Set API var to be relative to the current URL

This allows studio to be hosted on a different context path behind a reverse proxy. For example it is possible to use URLs like http://host/orient/studio/index.html