Refactored API; Finally got a unit test to run