Update API class to use singleton pattern