API js simplified a little.