Fixed DB caching, moved to JSON communication

DB caching wasn’t working, changed the SQL commands to utilize ON
DUPLICATE statement.
Moved from php_serialization to json for API, meter for moving forward.
fixed delete of expired items, formatting change
fixed quotes, moved to assoc array fetch

moved to assoc array to improve code readability
Merge pull request #9 from mikeMTOL/master

Fixed DB caching, moved to JSON communication