clean up chonglou's old code to fix project index bug, and add params security check for project id