Server: base loop and commands retrieval from HTTP