move json formatter in core and support json formatting in server

move json formatter in core and support json formatting in server