javascript api concept