refactored table view data source and networking code into its own class