Handle missing arguments error. Closes #8
Refactor getting credentials code