Handled null exceptions
Switched to linkedhashmap to maintain token order
added null exception handling
added error message output, checkRsp()
Merge origin/master