Extract JSON processing to a middleware

  - Apply it by default in order to mantain compatiblity, not sure it is
  the correct decision.