Fix convert_to_dict function for json validation

To also work on GET parameters, where before apparently it did not
work in certain cases.