Add static API_TYPE to generated types (fixes issue#152)