Validation and exception handling is implemented. Doc is updated.