adapt api.cpp and image to new filter interface