Return json for database code

Added a small change to return json object rather than list of
dictionaries