Properly escape backslashes in elastica queries