How to correctly create planetary orbits from kepler elements
If you're running your own N-body dynamics,
you can get initial Cartesian positions and velocities for each body in your system (including the Sun) by asking
JPL HORIZONS
for Ephemeris Type: Vectors.
I would choose Coordinate Origin: Solar System Barycenter so that the Sun does not drift away from the origin,
and Target Body: [Planet] Barycenter (or Sol) unless you are modeling the Earth and Moon as separate bodies.

If you still want to compute initial Cartesian positions and velocities from Keplerian elements, first do a sanity check: Earth should cross the X axis at the equinoxes and the Y axis at the solstices.
Second, those approximate elements for the major planets may not be precise enough for your purpose.
Instead you might ask HORIZONS for Ephemeris Type: Elements, and Time Span beginning with the epoch of your elements for Apophis.
You could also get elements for Apophis in a more convenient epoch this way.

Note that Keplerian elements are subject to dynamic evolution and are only valid for a limited time near their epoch.
If you ask HORIZONS for Apophis's orbital elements one week before and after its close approach to Earth, you can see that they are quite different. Of course the latter are also highly uncertain.

For the gory post-Newtonian details of the dynamical model the Apophis prediction article discussed extending, see JPL's
notes on DE430 and DE431, part III.