You got both wrong. Not bad.The situation with Peter has been covered multiple times here and a careful reading of it is more of a warning then an endorsement and James is a clear rebuke of Paul.
Salvation is by the Blood of Jesus Christ only !
You can say... but i did this and that good and obeyed the commandments. Yes but that's not what saves you !
You are saved by the atoning Blood of God spilt for the remission of sins !
Does that mean you don't obey the Ten Commandments of God and don't do good works ? Yes if you want Jesus to call you a fool !
Matthew 7 21"Not everyone who says to Me, ‘Lord, Lord,’ will enter the kingdom of heaven, but only he who does the will of My Father in heaven. 22Many will say to Me on that day, ‘Lord, Lord, did we not prophesy in Your name, and in Your name drive out demons and perform many miracles?’
23Then I will tell them plainly, ‘I never knew you; depart from Me, you workers of lawlessness!’
24Therefore everyone who hears these words of Mine and acts on them is like a wise man who built his house on the rock. 25The rain fell, the torrents raged, and the winds blew and beat against that house; yet it did not fall, because its foundation was on the rock.
26But everyone who hears these words of Mine and does not act on them is like a foolish man who built his house on sand. 27The rain fell, the torrents raged, and the winds blew and beat against that house, and it fell—and great was its collapse!”