use decorator to simplify code for ajax reply