Refactoring model & api tests.