Moved API code into backup file; refactored code to accept input, comments, etc.