adding ajax to obtain an apikey