delete useless code, add authentication