With a centralisation into one Map (like i propose in previous comment), that would be like that:
apiMap = (( 2 -> APIA2, APIB2 ), (3 -> APIA2, APIB2, APIC3 ), (4 -> APIA2, APIB4, APIC3 )) 

apiMap.foreach( (v,apis) => apis.foreach ( api => serve ( "api" / v / api.kind prefix api.requestDispatch)

and for latest version 

apiMap(apiMap.keySet.max).foreach( api => serve ( "api" / "latest" / api.kind prefix api.requestDispatch))