use empty array when no data exist for sensor
use human readable json format and fix order in query