Handling comm_api functions in python