removed functions from router file and added controller files