refactoring the questions js. also created a global function to add form messages for async actions