added some js to call api