rewrite some services to return json data