Refactored api calls, killed a lot of unncessary code.