Fixes issue with URL in dev mode for api2
More fixes for URL issues in dev environment (with port and subdomain)
Some UI enhancements for issue #1021