Server 2.0 and 2.1 had the media and template scanning processes embedded within the server. Server version 2.2 and later run the media scanner as a seperate, stand-alone task. The server distribution includes a batch file (casparcg_auto_restart.bat) that starts the scanner task then starts the server.
So you must either manually run the scanner task then start the server, or use the batch file to start them in the required sequence.
The scanner task also exposes some http: endpoints that allow an external task, such as a media manager, to fetch information about the templates and media files without using AMCP commands.