1030905 more api tests

Add api tests for filtering by date.
Also edited code for pep8 compliance for quality.
This test has an ambiguous result. It's not clear whether the correct behavior being tested is happening on purpose or by fluke because of the test data used.