Fixing unit tests and reintroducing mask since API filtering works