slightly refactored github api methods