Fix json responses by using the JsonResponse object + code style