Added doc and separated requests out into own function