fixing lots of bugs, refactoring controller code to handle async code better [#56612486]