rewrited serve.py to std out