Getting the correct site_url from configuration

This gets the correct site_url from the config.
Using h raised and exception while using harvesters (in our case) and probably in other configurations.

Moreover this removes unused imports