Fix api tests