Added python2/3 api.