Add REST handler and APIs for profile and statistics. Missing tests yet.