Fixing tp #600 and providing error message back to the user in a json object