Improve efficiency by not fetching layout if not needed in api.get Fix test failure by correctly merging existing metadata during update