Parse NDEF payload more efficiently.
cleanup code
Implemented error message for each API calling