inputtitle_submit.js: adding flags and conditionals to account for cases when the returned json object is empty, and adding/removing classes appropriately