Update app.js

add a forgotten fail check to a post request