python API efficiency updates