Accept both xml and json formats and added a validate parameters method.