refactored fetch method to take dict as input; added fetch testing