update code and example to filter on server side