clean and fix api tests