Deal with requests

def request(self, arg=None):
        '''Deal with requests'''
        if not self.status:
            return '{"result": "No message"}'

        try:
            status_dict = json.loads(mpstatus_to_json(self.status))
        except Exception as e:
            print(e)
            return

        # If no key, send the entire json
        if not arg:
            return json.dumps(status_dict)

        # Get item from path
        new_dict = status_dict
        args = arg.split('/')
        for key in args:
            if key in new_dict:
                new_dict = new_dict[key]
            else:
                return '{"key": "%s", "last_dict": %s}' % (key, json.dumps(new_dict))

        return json.dumps(new_dict)