Add an API to Python side