Improvements for server-side validation and error handling