Tests for API authorization