Print error on bad API usage.