basePathFromReferer parameter added to ApiDocumetationController

This adds the ability to construct basePath using referer URL if basePath is empty.