Modified avbutton endpoint to support new format of data sent by the frontend.