changed some each to map and made wrapper for requests