Merge pull request #20 from ralphtheninja/master

make sure to reply back error to client if pre-upgrade fails
add test for failed pre-upgrade