add switchboard and make api_port configurable in javascript