American Airlines is at terminal 8. You can take Airtrain to go between terminals, takes anywhere from one to ten minutes depending how far you need to go. You should allow at least a three hour layover to allow time for customs, terminal change, check-in and security.
American Airlines is at