Fixing some problems in api filtering