fixed bugs in passing of base url between functions (for relative url
definitions) and added check for top level parameters