Refactored and separated out API objects and data bits