added edit route and integrated api