fixed error codes (400 not 500) and added logging for json Co-authored-by: augustyd <kainytsugua.kerad@gmail.com> Reviewed-on: #138 Co-authored-by: Dariusz Augustyniak <augustyd@noreply.example.com> Co-committed-by: Dariusz Augustyniak <augustyd@noreply.example.com>