Organised code to config and models.
Send 422 if domain and document_path not in params.