use cache when debug
refactor app.py
use debug option when run server
use span10 instead span12
use metrics_file variable