1030905 more api tests

Add api tests for filtering by date.
Also edited code for pep8 compliance for quality.
I suspect the failures were because by default it is sorted in the order reverse what I expected. I removed this line and modified the tests accordingly.