put all the api stuff in one class