This was the cause of the bug you were seeing, having two routes with the same function name was confusing flask and it was sending requests to the wrong one.