added map to map form elements to model array, upsert to determine if it's a insert or update based on if the primary id is set.