Implement roundtrip tests for JSON encoding/deconding

Clarification and motivation

For now only correspondence of API to swagger spec is checked, but we don't have tests which would check that decode (encode s) == s holds.

Acceptance criteria

Roundtrip tests are implemented