implement error and response