Added challenge response authentication.
Added mail field. Added check for empty fields.