modified api.java for public filter