tweaks mailer
tweaks failure check
tweaks loading order
adds comment
refactors/improves http funtions