Changed facets/filters key-value loop

Do not use PHP functions like key(), if you don't have to. It leads to overhead.
The pretty printed JSON response is not needed. Add a HTTP Header to return it without pretty printing.