1030905 more api tests

Add api tests for filtering by date.
Also edited code for pep8 compliance for quality.
I think this should be a class setUp function. That might confuse `test_basic` though. In that case, maybe re-do `test_basic`, or maybe move the tests that need that setUp function to another class.