Use mysql function DATE in sqlalchemy
Add complete sql query for counting by day
Change return json by adding record list