Updates error handling and response codes