Return JSON in req handler