We went through Saturday night and it was 90 minutes to clear customs & immigration. First it was a 10+ minute fast paced walk from our AA arrival gate. We had downloaded the CBP mobile passport app and after exiting the aircraft hit send. We received a message that we are unable to process your request at this time. The next problem-several other international flights arrived at the same time. So after scanning our passports and being directed to a line we spent 1 hour moving forward. Finally at the CBP position we found the woman agent was rude to all. I will never fly through Miami again.