Refactor some of the tests, include new test checking that the api response has the correct number of objects