changed so that routes are defined separatly and methods are generated