implement error handler
handle extra field in data
handle enum error in read path, refactor tests