updates api request and js for global variables
fixes merge in api call