Fixes validation of emails and webhooks. Fixed the incorrect indentation as well. Added unit tests as well.

Change-Id: I2d6f8e5323be2e927bf79deee11e65544cd25ac5
Merge "Fixes validation of emails and webhooks. Fixed the incorrect indentation as well. Added unit tests as well."