Much improved datahandler implemented on both view page and in API.