fixed tests; added test for capabilities API and fixed malformed JSON in capabilities response