finish returning http status code along with error