Housekeeping and better construction of response JSON