Basic javascript call to API