public async Task <APIGatewayProxyResponse> Coin(APIGatewayProxyRequest request, ILambdaContext context) { _logger.Log($"{nameof(Coin)} API called."); if (request.PathParameters == null || !request.PathParameters.ContainsKey(SYMBOL_PARAM_NAME)) { return new APIGatewayProxyResponse { StatusCode = (int)HttpStatusCode.BadRequest, Body = $"Missing required parameter {SYMBOL_PARAM_NAME}" } } ; var symbol = HttpUtility.UrlDecode(request.PathParameters[SYMBOL_PARAM_NAME]); if (!_coinRepository.CoinExists(symbol)) { return new APIGatewayProxyResponse { StatusCode = (int)HttpStatusCode.NotFound, Body = $"Symbol not found: {symbol}" } } ; var coinStats = await _coinRepository.GetCoinStats(symbol); return(CreateAPIGatewayProxyResponse(coinStats)); }