Added JSON API for devices request.