implemented json responses for post/put requests