add some python file for server exception and make a APIHandler for tornado handler