TestAPI.java with fixes, preliminary version