Added new function that returns a mysql-query as json-object