resource handlers and client script