Decides what to do based on the URL, also changed to case statement logic