Adapt to error handling changes in Restler lib

Added 'fail' case to error handling. Still needs some DRYing out.