integrated js to api