Improved API compliance and added API unit tests