Adding proper base URL support

Change-Id: Ied56a729d07d8f58cf5677bdac0ec8ca588b8d6e