moved oauth and api to their own classes in lib