Added map legend in the map
Cleaned the code a bit in handlers.py