tests/api.c updated