create a class for result
use Template to output text result
modified to output with template
modified for output, implement the api_mode