Stop serving

def stop_server(self):
        """
        Stop serving
        """
        if self.api_server is not None:
            try:
                self.api_server.socket.shutdown(socket.SHUT_RDWR)
            except:
                log.warning("Failed to shut down API server socket")

            self.api_server.shutdown()