Current State
There are various instances in routes.py file where we are fetching the URL parameters without checking to see whether they exist. This causes the API to throw a python error which does not make sense.
Solution
In order to avoid that, we need to add various checks to ensure that the parameters that we are accessing actually do exist in the dictionary.