cleanup response format and small bugs