Working def allegro_api