Tank hasn't cycled, how long has it been set up?
Swordtails are fine in there.. I've kept them 20+ yrs and many had been in 10g. Tank isn't over stocked.
You did right by doing a small water change when you saw the ammonia.. your tank is probably trying to cycle, so continue to monitor it often and do changes to the water when ammonia raises.
You want ammonia and Nitrite to be at 0, while Nitrates roughly around 20 - no higher than 40. Your tank will be cycled once you have 0 ammonia/nitrite and 1-40 nitrate.
Ammonia will harm to fish if it is too high, you will want to keep it below 25ppm - but ideally you want 0.
The ammonia will spike as the tank cycles, as well as when there is excess food/waste debris built up. Make sure to do weekly 50% water changes, along with small water changes in between when you see the numbers creep up.