added some basic configuration, debug and work on email handlers