check for error in end call and pass on to done if err exists

Looks like only one of the calls was failing with a 200 actual but a 201 expected. I changed it to a 200 but I might be wrong in doing that.