Removed iframe subdomain hack, added code to determine which api server instance to use based on the application's url