adding tests for formatting responses. pep8 mods. fixed indexing of dictionary in resources.py