only url encode a nested dictionary if it contains elements
fixed encoding of nested dictionaries in parameters for HTTP body