Fix CodeSniffer errors and warnings (final round for API classes)