Added tests to /sites* end points. See #2.

When writing the tests a few bugs have been discovered. See ticket #49,
ticket #50 and ticket #51.