Begun work on refactoring API to its own file