api: vat2 and json autogeneration for api messages