public static GetProjects_Result getProjects(Database database, GetProjects_Param params) {
        
        Logger.getLogger(API.class.getName()).log(Level.FINE, "Entering API.getProjects()");
        GetProjects_Result result;
        try {
            ValidateUser_Result vResult = validateUser(database, new ValidateUser_Param(params.username(), params.password()));
            if (vResult == null || !vResult.validated()) {
                result = null;
            }
            else {
                
                // Get all Projects
                ArrayList<Project> projects = (ArrayList) database.get(new Project());
                
                // Add them to GetProjects_Result
                ArrayList<Integer> ids = new ArrayList<>();
                ArrayList<String> names = new ArrayList<>();
                for (Project project : projects) {
                    ids.add(new Integer(project.projectId()));
                    names.add(project.title());
                }
                result = new GetProjects_Result(ids, names);
            }
        }
        catch (DatabaseException | GetFailedException ex) {
            result = null;
            Logger.getLogger(API.class.getName()).log(Level.WARNING, "getProjects request failed.", ex);
        }
        catch (GetProjects_Result.GetProjects_ResultException ex) {
            result = null;
            Logger.getLogger(API.class.getName()).log(Level.SEVERE, null, ex);
        }
        Logger.getLogger(API.class.getName()).log(Level.FINE, "Exiting API.getProjects()");
        return result;
        
    }