Improved validation in backend. Improved and encapsulated validation better on frontend