Fix exception handling
Update metadata, add ID in REST API