API tests.
Fix scalastyle warnings.
Spelling, comments, variable name.