I found this piece of a very useful python script for processing cherrypy server:
def uses_json(func): @functools.wraps(func) @cherrypy.tools.accept(