Refactored out API functionality, added more spec stub files