Added more validation to the restful interface.