public IHttpActionResult AddADocument([FromUri] string user_email, [FromBody] AddDocument document)
        {
            if (IsTokenValid() && authenticationService.IsAllowedToAddDocument(GetTokenUserEmail(), user_email))
            {
                try
                {
                    Document     newDocument      = documentManagementService.Add(user_email, AddDocument.ToEntity(document));
                    BaseDocument modelNewDocument = BaseDocument.ToModel(newDocument);
                    documentLogger.LogModificationToDocument(modelNewDocument.Id);

                    return(CreatedAtRoute("AddDocument", new { useremail = user_email, documentid = modelNewDocument.Id }, modelNewDocument));
                }
                catch (MissingUserException e)
                {
                    return(BadRequest(e.Message));
                }
                catch (Exceptions e)
                {
                    return(BadRequest(e.Message));
                }
            }

            return(Unauthorized());
        }