control behaviour of the module

def cmds(self, args):
        '''control behaviour of the module'''
        if not args or len(args) < 1:
            print(self.usage())
            return

        if args[0] == "start":
            if self.rest_server.running():
                print("Rest server already running.")
                return
            self.rest_server.start()
            print("Rest server running: %s:%s" % \
                (self.rest_server.address, self.rest_server.port))

        elif args[0] == "stop":
            if not self.rest_server.running():
                print("Rest server is not running.")
                return
            self.rest_server.stop()

        elif args[0] == "address":
            # Check if have necessary amount of arguments
            if len(args) != 2:
                print("usage: restserver address <ip:port>")
                return

            address = args[1].split(':')
            # Check if argument is correct
            if len(address) == 2:
                self.rest_server.set_ip_port(address[0], int(address[1]))
                return

        else:
            print(self.usage())