Fixes after code review (fixed test, changed JSON handling, JSON payload object, etc)