First part of update to handle MySQL errors and display modals using ui-angular 75% of #4 and 50% of #3 - work in progress