convert integers in JSON responses to intervals in SQL
Style fixes.
Documents interval recognition.