change url routing, add logging and debug print flag