Add ajax call completion wait check.
Fix xblock tests

Fix after Code Review.