better way to send json response