Added error checking to API result in submit.js