Update api.py

refer to correct setting attribute