Make calls to main function in router result in server error