Added error handling on main functions with custom error form. Not tested on errors on asyn calls.