Made api object oriented to make adding new apis easier.