API test fixes and dir/Makefile cleanup