Added handlers for json and xml producing