Core: remove trailing commas from api arrays