Update api.py, new API support

Added support for tuning GPU clock settings via the API and a couple of useful utility functions.