Add PHPUnit tests for API services