more api tests, more fixes