handle incoming json