improved api filter mechanism