Fixing minor bugs in service.py