Added handlers to communicate with JSON API