fixing up api request and tests