Make api_gen.py runnable again