changed str2api(); add test