Added /debug route with some new functions