update handler to return json