/// <summary>
 /// API to create a new admin corresponding to a new organisation.
 /// </summary>
 /// <param name="admin"></param>
 /// <returns></returns>
 public IHttpActionResult PostCreateAdmin(Admin admin)
 {
     _Logger.Info("PostCreateAdmin API called.");
     try
     {
         _ExceptionCheck.ValidateOrganisation(admin);
         admin = _BusinessOperations.InsertAdmin(admin);
         if (admin.OrganisationID == "0")
         {
             _Logger.Error("Admin Not Added");
             return(base.NotFound());
         }
         else
         {
             return(base.Ok(admin));
         }
     }
     catch (EmployeeManagementExceptions exception)
     {
         _Logger.Error(exception.ToString());
         return(InternalServerError(exception));
     }
     catch (MySqlException exception)
     {
         _Logger.Error(exception.ToString());
         if (exception.Message.Contains("adminemail"))
         {
             return(Content((HttpStatusCode)555, "Database Error"));
         }
         if (exception.Message.Contains("Duplicate"))
         {
             return(Content((HttpStatusCode)422, "Database Error"));
         }
         else
         {
             return(InternalServerError(exception));
         }
     }
     catch (Exception ex)
     {
         _Logger.Fatal(ex.ToString());
         return(InternalServerError(ex));
     }
 }