Updated js to work with new expectations for api calls.