send json back and redirect on client