Pulled JSON format query param check into a separate function