Added custom error controllers - Many fixes - Better errors logic and no more global vars