Javascript api