support to ajax and pjax

A special template is called when the request was made via ajax or pjax.
direct JsonResponse

Not when the processes are a response object JsonResponse
Indentation
Decoupling methods.