Specify errors types

Added getErrors function to retrieve validations errors.