Added query string values check and wrapped results in { result: xxx } envelope