Add Python api and listener