Testing when projects don't exist or github returns errors

- Also doing some refactoring