api routing logic moved to separate file