public ActionResult <List <BlockDTO> > GetBlocksByUser([FromHeader] string key, int userID) { if (!_authService.Authorize(key)) { return(StatusCode(StatusCodes.Status401Unauthorized, "User authorization failed!")); } try { var type = _blockingService.GetBlocksByUser(userID); if (type == null) { return(NotFound()); } logger.LogInformation("Successfully returned block based on ID"); return(Ok(type)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }