add web api function for getUrl instead of string in base, use externalAddress optional config key to define external behaviours [#264]