Return 500 HTTP code in case of PHP fatal errors

This allow client-side to react correctly in case of fatal
errors and not try to parse HTML response as JSON
Keep filters in the same order as selected #3003