Format data to send back right format