Merge pull request #1 from rampage644/master

Authentication
Fix get_json_key function
Fix get_json_key function2
fixed some memory problems
Merge pull request #2 from pkit/auth

fixed some memory problems