Use symfony JsonResponse for API
Merge pull request #1026 from romainneutron/json-response

[Ready][3.9] Use symfony JsonResponse for API