added actual error handling to /history