Merge common Python (not ready)

Need to change anything that uses api.py.