If ammonia or nitrite test above zero with fish in the tank, do a 50% water change. Use a water conditioner, one that detoxifies ammonia and nitrite is advisable during the initial period. Not all do this; Prime and Ultimate do. They are effective for 36-48 hours, and ammonia and nitrite will still show with the API test even though they are non-toxic during that period. But if they continue into the second day following the water change, do another 50% change, and so on.
Live plants are the best and safest way to "cycle" a new tank. With enough fast-growing plants, they will handle the ammonia and there will be no discernable cycle and thus no harm to the fish. Even some stem plants floating will achieve this.
Here is an article written by one of our members on cycling that will give some background:
The fishless cycling is mentioned in that article; it works, but rather than fuss with that I use live plants.