I could remove custom code. The cql filter is now properly embedded (and escaped) in the params json