Update server.py

fixed the function in profile section which was not working due to changes in yaml file