Fixed status codes, added email config where we want to use email