JS api corrected