Add unit tests for refactored API modules